diff --git a/.github/workflows/syntax.yml b/.github/workflows/syntax.yml index ee91eb13..560dd7dc 100644 --- a/.github/workflows/syntax.yml +++ b/.github/workflows/syntax.yml @@ -23,9 +23,9 @@ jobs: run: pip install flake8 - name: Syntax Error Check run: | - flake8 nw --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 novelwriter --count --select=E9,F63,F7,F82 --show-source --statistics flake8 tests --count --select=E9,F63,F7,F82 --show-source --statistics - name: Coding Style Violations run: | - flake8 nw --count --max-line-length=99 --ignore E221,E226,E228,E241 --show-source --statistics + flake8 novelwriter --count --max-line-length=99 --ignore E221,E226,E228,E241 --show-source --statistics flake8 tests --count --max-line-length=99 --ignore E221,E226,E228,E241 --show-source --statistics diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index 419059a7..b2be08eb 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -36,6 +36,6 @@ jobs: - name: Run Tests run: | export QT_QPA_PLATFORM=offscreen - pytest -v --cov=nw --timeout=60 + pytest -v --cov=novelwriter --timeout=60 - name: Upload to Codecov uses: codecov/codecov-action@v1 diff --git a/.github/workflows/test_mac.yml b/.github/workflows/test_mac.yml index 397834b4..c9b4497c 100644 --- a/.github/workflows/test_mac.yml +++ b/.github/workflows/test_mac.yml @@ -31,6 +31,6 @@ jobs: - name: Run Tests run: | export QT_QPA_PLATFORM=offscreen - pytest -v --cov=nw --timeout=60 + pytest -v --cov=novelwriter --timeout=60 - name: Upload to Codecov uses: codecov/codecov-action@v1 diff --git a/.github/workflows/test_win.yml b/.github/workflows/test_win.yml index 7af172cc..85a0fda6 100644 --- a/.github/workflows/test_win.yml +++ b/.github/workflows/test_win.yml @@ -26,6 +26,6 @@ jobs: pip install -r requirements-dev.txt - name: Run Tests run: | - pytest -v --cov=nw --timeout=60 + pytest -v --cov=novelwriter --timeout=60 - name: Upload to Codecov uses: codecov/codecov-action@v1 diff --git a/.gitignore b/.gitignore index 6645bcf1..df455135 100644 --- a/.gitignore +++ b/.gitignore @@ -10,15 +10,15 @@ novelwriter.desktop novelWriter.pyw # Translations -/nw/assets/i18n/*.qm +/novelwriter/assets/i18n/*.qm .qmake.stash i18n/*.qm i18n/*.qph # Documentation /docs/build/ -/nw/assets/help/html/ -/nw/assets/help/manual.pdf +/novelwriter/assets/help/html/ +/novelwriter/assets/help/manual.pdf /UserManual.pdf *.qch *.qhc @@ -28,7 +28,7 @@ __pycache__ *.pyc # Sample Project -/nw/assets/sample.zip +/novelwriter/assets/sample.zip /sample/cache /sample/meta /sample/versions diff --git a/MANIFEST.in b/MANIFEST.in index 0d7dcd2a..c78958b1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,5 +2,5 @@ include setup.py include LICENSE.md include CHANGELOG.md recursive-include setup * -recursive-include nw/assets * +recursive-include novelwriter/assets * recursive-include sample *.nwx *.nwd diff --git a/docs/source/int_started.rst b/docs/source/int_started.rst index 51a3f67e..537fdcc2 100644 --- a/docs/source/int_started.rst +++ b/docs/source/int_started.rst @@ -112,8 +112,8 @@ Building the Translation Files If you installed novelWriter from a package, the translation files should be pre-built and included. If you're running novelWriter from the source code, you will need to generate the files -yourself. The files you need will be written to the ``nw/assets/i18n`` folder, and will have the -``.qm`` file extension. +yourself. The files you need will be written to the ``novelwriter/assets/i18n`` folder, and will +have the ``.qm`` file extension. You can build the ``.qm`` files with: diff --git a/docs/source/tech_tests.rst b/docs/source/tech_tests.rst index 5fe24149..2c9c7e08 100644 --- a/docs/source/tech_tests.rst +++ b/docs/source/tech_tests.rst @@ -51,7 +51,7 @@ You can also add coverage report generation. For instance to HTML: .. code-block:: console - xvfb-run pytest -v --cov=nw --cov-report=html + xvfb-run pytest -v --cov=novelwriter --cov-report=html Other useful report formats are ``xml``, and ``term`` for terminal output. @@ -60,7 +60,7 @@ subpackage groups are ``base``, ``core``, and ``gui``. Consider for instance: .. code-block:: console - xvfb-run pytest -v --cov=nw --cov-report=html -m core + xvfb-run pytest -v --cov=novelwriter --cov-report=html -m core This will only run the tests of the "core" package, that is, all the classes that deal with the project data of a novelWriter project. The "gui" tests, likewise, will run the tests for the GUI @@ -71,7 +71,7 @@ You can also filter the tests with the ``-k`` switch. The following will do the .. code-block:: console - xvfb-run pytest -v --cov=nw --cov-report=html -k testCore + xvfb-run pytest -v --cov=novelwriter --cov-report=html -k testCore All tests are named in such a way that you can filter them by adding more bits of the test names. They all start with the word "test". Then comes the group: "Core", "Base", "Dlg", "Tool", or "Gui". @@ -80,6 +80,6 @@ file. For instance, running the following will run all tests for the document ed .. code-block:: console - xvfb-run pytest -v --cov=nw --cov-report=html -k testGuiEditor + xvfb-run pytest -v --cov=novelwriter --cov-report=html -k testGuiEditor To run a single test, simply add the full test name to the ``-k`` switch. diff --git a/i18n/README.md b/i18n/README.md index 73d71932..cb89e870 100644 --- a/i18n/README.md +++ b/i18n/README.md @@ -3,8 +3,8 @@ The `i18n` folder contains the translation files for the Qt5 GUI. There are two types of files involved: the `nw_XX.ts` and the `nw_XX.qm` files. The `nw_XX.ts` files are located in the `i18n` folder at the root of the repository, and the `nw_XX.qm` together with the `project_XX.json` files -are located in `nw/assets/i18n`. The latter are JSON translation maps for the novelWriter projects, -used by the Build Novel Project tool. +are located in `novelwriter/assets/i18n`. The latter are JSON translation maps for the novelWriter +projects, used by the Build Novel Project tool. **Note** @@ -35,7 +35,7 @@ edited with the Qt 5 Linguist application provided by Qt. This is by far easier editing the `.ts` file. Please select "English" and "United Kingdom" as the source langauge when prompted by Qt 5 Linguist. -When you're done editing, you can build the `nw/assets/i18n/nw_XX.qm` file and test it in +When you're done editing, you can build the `novelwriter/assets/i18n/nw_XX.qm` file and test it in novelWriter. The Preferences dialog should list the newly added language, and you can select it and test it. @@ -71,8 +71,8 @@ files. ## Project Localisation Projects can have a different language setting than the GUI itself. The files with format -`project_XX.json` in `nw/assets/i18n` are simple translation maps for text that goes into the -exported documents generated by the Build Novel Project tool. +`project_XX.json` in `novelwriter/assets/i18n` are simple translation maps for text that goes into +the exported documents generated by the Build Novel Project tool. The files are loaded based on the language setting in the build tool. At the present time, no other parts of the application use these files. Since these are used as replacement lookups, they are diff --git a/novelWriter.pro b/novelWriter.pro index 1bca0161..39b0008a 100644 --- a/novelWriter.pro +++ b/novelWriter.pro @@ -1,34 +1,34 @@ SOURCES += \ i18n/qtbase.py \ - nw/core/project.py \ - nw/core/tokenizer.py \ - nw/dialogs/about.py \ - nw/dialogs/docmerge.py \ - nw/dialogs/docsplit.py \ - nw/dialogs/itemeditor.py \ - nw/dialogs/preferences.py \ - nw/dialogs/projload.py \ - nw/dialogs/projsettings.py \ - nw/dialogs/wordlist.py \ - nw/gui/custom.py \ - nw/gui/doceditor.py \ - nw/gui/docviewer.py \ - nw/gui/itemdetails.py \ - nw/gui/mainmenu.py \ - nw/gui/noveltree.py \ - nw/gui/outline.py \ - nw/gui/outlinedetails.py \ - nw/gui/projdetails.py \ - nw/gui/projtree.py \ - nw/gui/statusbar.py \ - nw/gui/theme.py \ - nw/tools/build.py \ - nw/tools/projwizard.py \ - nw/tools/writingstats.py \ - nw/common.py \ - nw/constants.py \ - nw/error.py \ - nw/guimain.py + novelwriter/core/project.py \ + novelwriter/core/tokenizer.py \ + novelwriter/dialogs/about.py \ + novelwriter/dialogs/docmerge.py \ + novelwriter/dialogs/docsplit.py \ + novelwriter/dialogs/itemeditor.py \ + novelwriter/dialogs/preferences.py \ + novelwriter/dialogs/projload.py \ + novelwriter/dialogs/projsettings.py \ + novelwriter/dialogs/wordlist.py \ + novelwriter/gui/custom.py \ + novelwriter/gui/doceditor.py \ + novelwriter/gui/docviewer.py \ + novelwriter/gui/itemdetails.py \ + novelwriter/gui/mainmenu.py \ + novelwriter/gui/noveltree.py \ + novelwriter/gui/outline.py \ + novelwriter/gui/outlinedetails.py \ + novelwriter/gui/projdetails.py \ + novelwriter/gui/projtree.py \ + novelwriter/gui/statusbar.py \ + novelwriter/gui/theme.py \ + novelwriter/tools/build.py \ + novelwriter/tools/projwizard.py \ + novelwriter/tools/writingstats.py \ + novelwriter/common.py \ + novelwriter/constants.py \ + novelwriter/error.py \ + novelwriter/guimain.py TRANSLATIONS += \ i18n/nw_en_US.ts \ diff --git a/novelWriter.py b/novelWriter.py index 17e40a09..33ce3768 100755 --- a/novelWriter.py +++ b/novelWriter.py @@ -17,5 +17,5 @@ except Exception: os.curdir = os.path.abspath(os.path.dirname(__file__)) if __name__ == "__main__": - import nw - nw.main(sys.argv[1:]) + import novelwriter + novelwriter.main(sys.argv[1:]) diff --git a/nw/__init__.py b/novelwriter/__init__.py similarity index 96% rename from nw/__init__.py rename to novelwriter/__init__.py index 21d9944d..a4ebb86b 100644 --- a/nw/__init__.py +++ b/novelwriter/__init__.py @@ -30,8 +30,8 @@ import logging from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QApplication, QErrorMessage -from nw.error import exceptionHandler, logException -from nw.config import Config +from novelwriter.error import exceptionHandler, logException +from novelwriter.config import Config ## # Version Scheme @@ -55,7 +55,7 @@ from nw.config import Config # 0x010201f0 : 1.2.1 1.2.1 Patch release ## -__package__ = "nw" +__package__ = "novelwriter" __copyright__ = "Copyright 2018–2021, Veronica Berglyd Olsen" __license__ = "GPLv3" __author__ = "Veronica Berglyd Olsen" @@ -185,10 +185,10 @@ def main(sysArgs=None): logLevel = logging.INFO elif inOpt == "--debug": logLevel = logging.DEBUG - logFormat = "[{asctime:}] {name:>22}:{lineno:<4d} {levelname:8} {message:}" + logFormat = "[{asctime:}] {filename:>17}:{lineno:<4d} {levelname:8} {message:}" elif inOpt == "--verbose": logLevel = VERBOSE - logFormat = "[{asctime:}] {name:>22}:{lineno:<4d} {levelname:8} {message:}" + logFormat = "[{asctime:}] {filename:>17}:{lineno:<4d} {levelname:8} {message:}" elif inOpt == "--style": qtStyle = inArg elif inOpt == "--config": @@ -276,7 +276,7 @@ def main(sysArgs=None): logException() # Import GUI (after dependency checks), and launch - from nw.guimain import GuiMain + from novelwriter.guimain import GuiMain if testMode: nwGUI = GuiMain() return nwGUI diff --git a/nw/assets/dict/README.md b/novelwriter/assets/dict/README.md similarity index 100% rename from nw/assets/dict/README.md rename to novelwriter/assets/dict/README.md diff --git a/nw/assets/dict/copyright.txt b/novelwriter/assets/dict/copyright.txt similarity index 100% rename from nw/assets/dict/copyright.txt rename to novelwriter/assets/dict/copyright.txt diff --git a/nw/assets/dict/en.dict b/novelwriter/assets/dict/en.dict similarity index 100% rename from nw/assets/dict/en.dict rename to novelwriter/assets/dict/en.dict diff --git a/nw/assets/dict/en_GB.dict b/novelwriter/assets/dict/en_GB.dict similarity index 100% rename from nw/assets/dict/en_GB.dict rename to novelwriter/assets/dict/en_GB.dict diff --git a/nw/assets/dict/en_US.dict b/novelwriter/assets/dict/en_US.dict similarity index 100% rename from nw/assets/dict/en_US.dict rename to novelwriter/assets/dict/en_US.dict diff --git a/nw/assets/fonts/Cantarell/Cantarell-Bold.ttf b/novelwriter/assets/fonts/Cantarell/Cantarell-Bold.ttf similarity index 100% rename from nw/assets/fonts/Cantarell/Cantarell-Bold.ttf rename to novelwriter/assets/fonts/Cantarell/Cantarell-Bold.ttf diff --git a/nw/assets/fonts/Cantarell/Cantarell-BoldItalic.ttf b/novelwriter/assets/fonts/Cantarell/Cantarell-BoldItalic.ttf similarity index 100% rename from nw/assets/fonts/Cantarell/Cantarell-BoldItalic.ttf rename to novelwriter/assets/fonts/Cantarell/Cantarell-BoldItalic.ttf diff --git a/nw/assets/fonts/Cantarell/Cantarell-Italic.ttf b/novelwriter/assets/fonts/Cantarell/Cantarell-Italic.ttf similarity index 100% rename from nw/assets/fonts/Cantarell/Cantarell-Italic.ttf rename to novelwriter/assets/fonts/Cantarell/Cantarell-Italic.ttf diff --git a/nw/assets/fonts/Cantarell/Cantarell-Regular.ttf b/novelwriter/assets/fonts/Cantarell/Cantarell-Regular.ttf similarity index 100% rename from nw/assets/fonts/Cantarell/Cantarell-Regular.ttf rename to novelwriter/assets/fonts/Cantarell/Cantarell-Regular.ttf diff --git a/nw/assets/fonts/Cantarell/OFL.txt b/novelwriter/assets/fonts/Cantarell/OFL.txt similarity index 100% rename from nw/assets/fonts/Cantarell/OFL.txt rename to novelwriter/assets/fonts/Cantarell/OFL.txt diff --git a/nw/assets/i18n/project_de.json b/novelwriter/assets/i18n/project_de.json similarity index 100% rename from nw/assets/i18n/project_de.json rename to novelwriter/assets/i18n/project_de.json diff --git a/nw/assets/i18n/project_en.json b/novelwriter/assets/i18n/project_en.json similarity index 100% rename from nw/assets/i18n/project_en.json rename to novelwriter/assets/i18n/project_en.json diff --git a/nw/assets/i18n/project_fr.json b/novelwriter/assets/i18n/project_fr.json similarity index 100% rename from nw/assets/i18n/project_fr.json rename to novelwriter/assets/i18n/project_fr.json diff --git a/nw/assets/i18n/project_nb_NO.json b/novelwriter/assets/i18n/project_nb_NO.json similarity index 100% rename from nw/assets/i18n/project_nb_NO.json rename to novelwriter/assets/i18n/project_nb_NO.json diff --git a/nw/assets/i18n/project_nn_NO.json b/novelwriter/assets/i18n/project_nn_NO.json similarity index 100% rename from nw/assets/i18n/project_nn_NO.json rename to novelwriter/assets/i18n/project_nn_NO.json diff --git a/nw/assets/i18n/project_pt.json b/novelwriter/assets/i18n/project_pt.json similarity index 100% rename from nw/assets/i18n/project_pt.json rename to novelwriter/assets/i18n/project_pt.json diff --git a/nw/assets/i18n/project_zh_CN.json b/novelwriter/assets/i18n/project_zh_CN.json similarity index 100% rename from nw/assets/i18n/project_zh_CN.json rename to novelwriter/assets/i18n/project_zh_CN.json diff --git a/nw/assets/icons/fallback/README.md b/novelwriter/assets/icons/fallback/README.md similarity index 100% rename from nw/assets/icons/fallback/README.md rename to novelwriter/assets/icons/fallback/README.md diff --git a/nw/assets/icons/fallback/add-dark.svg b/novelwriter/assets/icons/fallback/add-dark.svg similarity index 100% rename from nw/assets/icons/fallback/add-dark.svg rename to novelwriter/assets/icons/fallback/add-dark.svg diff --git a/nw/assets/icons/fallback/add.svg b/novelwriter/assets/icons/fallback/add.svg similarity index 100% rename from nw/assets/icons/fallback/add.svg rename to novelwriter/assets/icons/fallback/add.svg diff --git a/nw/assets/icons/fallback/backward-dark.svg b/novelwriter/assets/icons/fallback/backward-dark.svg similarity index 100% rename from nw/assets/icons/fallback/backward-dark.svg rename to novelwriter/assets/icons/fallback/backward-dark.svg diff --git a/nw/assets/icons/fallback/backward.svg b/novelwriter/assets/icons/fallback/backward.svg similarity index 100% rename from nw/assets/icons/fallback/backward.svg rename to novelwriter/assets/icons/fallback/backward.svg diff --git a/nw/assets/icons/fallback/bullet-off-dark.svg b/novelwriter/assets/icons/fallback/bullet-off-dark.svg similarity index 100% rename from nw/assets/icons/fallback/bullet-off-dark.svg rename to novelwriter/assets/icons/fallback/bullet-off-dark.svg diff --git a/nw/assets/icons/fallback/bullet-off.svg b/novelwriter/assets/icons/fallback/bullet-off.svg similarity index 100% rename from nw/assets/icons/fallback/bullet-off.svg rename to novelwriter/assets/icons/fallback/bullet-off.svg diff --git a/nw/assets/icons/fallback/bullet-on-dark.svg b/novelwriter/assets/icons/fallback/bullet-on-dark.svg similarity index 100% rename from nw/assets/icons/fallback/bullet-on-dark.svg rename to novelwriter/assets/icons/fallback/bullet-on-dark.svg diff --git a/nw/assets/icons/fallback/bullet-on.svg b/novelwriter/assets/icons/fallback/bullet-on.svg similarity index 100% rename from nw/assets/icons/fallback/bullet-on.svg rename to novelwriter/assets/icons/fallback/bullet-on.svg diff --git a/nw/assets/icons/fallback/check-dark.svg b/novelwriter/assets/icons/fallback/check-dark.svg similarity index 100% rename from nw/assets/icons/fallback/check-dark.svg rename to novelwriter/assets/icons/fallback/check-dark.svg diff --git a/nw/assets/icons/fallback/check.svg b/novelwriter/assets/icons/fallback/check.svg similarity index 100% rename from nw/assets/icons/fallback/check.svg rename to novelwriter/assets/icons/fallback/check.svg diff --git a/nw/assets/icons/fallback/cross-dark.svg b/novelwriter/assets/icons/fallback/cross-dark.svg similarity index 100% rename from nw/assets/icons/fallback/cross-dark.svg rename to novelwriter/assets/icons/fallback/cross-dark.svg diff --git a/nw/assets/icons/fallback/cross.svg b/novelwriter/assets/icons/fallback/cross.svg similarity index 100% rename from nw/assets/icons/fallback/cross.svg rename to novelwriter/assets/icons/fallback/cross.svg diff --git a/nw/assets/icons/fallback/forward-dark.svg b/novelwriter/assets/icons/fallback/forward-dark.svg similarity index 100% rename from nw/assets/icons/fallback/forward-dark.svg rename to novelwriter/assets/icons/fallback/forward-dark.svg diff --git a/nw/assets/icons/fallback/forward.svg b/novelwriter/assets/icons/fallback/forward.svg similarity index 100% rename from nw/assets/icons/fallback/forward.svg rename to novelwriter/assets/icons/fallback/forward.svg diff --git a/nw/assets/icons/fallback/hash-dark.svg b/novelwriter/assets/icons/fallback/hash-dark.svg similarity index 100% rename from nw/assets/icons/fallback/hash-dark.svg rename to novelwriter/assets/icons/fallback/hash-dark.svg diff --git a/nw/assets/icons/fallback/hash.svg b/novelwriter/assets/icons/fallback/hash.svg similarity index 100% rename from nw/assets/icons/fallback/hash.svg rename to novelwriter/assets/icons/fallback/hash.svg diff --git a/nw/assets/icons/fallback/maximise-dark.svg b/novelwriter/assets/icons/fallback/maximise-dark.svg similarity index 100% rename from nw/assets/icons/fallback/maximise-dark.svg rename to novelwriter/assets/icons/fallback/maximise-dark.svg diff --git a/nw/assets/icons/fallback/maximise.svg b/novelwriter/assets/icons/fallback/maximise.svg similarity index 100% rename from nw/assets/icons/fallback/maximise.svg rename to novelwriter/assets/icons/fallback/maximise.svg diff --git a/nw/assets/icons/fallback/minimise-dark.svg b/novelwriter/assets/icons/fallback/minimise-dark.svg similarity index 100% rename from nw/assets/icons/fallback/minimise-dark.svg rename to novelwriter/assets/icons/fallback/minimise-dark.svg diff --git a/nw/assets/icons/fallback/minimise.svg b/novelwriter/assets/icons/fallback/minimise.svg similarity index 100% rename from nw/assets/icons/fallback/minimise.svg rename to novelwriter/assets/icons/fallback/minimise.svg diff --git a/nw/assets/icons/fallback/proj_nwx.svg b/novelwriter/assets/icons/fallback/proj_nwx.svg similarity index 100% rename from nw/assets/icons/fallback/proj_nwx.svg rename to novelwriter/assets/icons/fallback/proj_nwx.svg diff --git a/nw/assets/icons/fallback/reference-dark.svg b/novelwriter/assets/icons/fallback/reference-dark.svg similarity index 100% rename from nw/assets/icons/fallback/reference-dark.svg rename to novelwriter/assets/icons/fallback/reference-dark.svg diff --git a/nw/assets/icons/fallback/reference.svg b/novelwriter/assets/icons/fallback/reference.svg similarity index 100% rename from nw/assets/icons/fallback/reference.svg rename to novelwriter/assets/icons/fallback/reference.svg diff --git a/nw/assets/icons/fallback/refresh-dark.svg b/novelwriter/assets/icons/fallback/refresh-dark.svg similarity index 100% rename from nw/assets/icons/fallback/refresh-dark.svg rename to novelwriter/assets/icons/fallback/refresh-dark.svg diff --git a/nw/assets/icons/fallback/refresh.svg b/novelwriter/assets/icons/fallback/refresh.svg similarity index 100% rename from nw/assets/icons/fallback/refresh.svg rename to novelwriter/assets/icons/fallback/refresh.svg diff --git a/nw/assets/icons/fallback/remove-dark.svg b/novelwriter/assets/icons/fallback/remove-dark.svg similarity index 100% rename from nw/assets/icons/fallback/remove-dark.svg rename to novelwriter/assets/icons/fallback/remove-dark.svg diff --git a/nw/assets/icons/fallback/remove.svg b/novelwriter/assets/icons/fallback/remove.svg similarity index 100% rename from nw/assets/icons/fallback/remove.svg rename to novelwriter/assets/icons/fallback/remove.svg diff --git a/nw/assets/icons/fallback/search-dark.svg b/novelwriter/assets/icons/fallback/search-dark.svg similarity index 100% rename from nw/assets/icons/fallback/search-dark.svg rename to novelwriter/assets/icons/fallback/search-dark.svg diff --git a/nw/assets/icons/fallback/search-replace-dark.svg b/novelwriter/assets/icons/fallback/search-replace-dark.svg similarity index 100% rename from nw/assets/icons/fallback/search-replace-dark.svg rename to novelwriter/assets/icons/fallback/search-replace-dark.svg diff --git a/nw/assets/icons/fallback/search-replace.svg b/novelwriter/assets/icons/fallback/search-replace.svg similarity index 100% rename from nw/assets/icons/fallback/search-replace.svg rename to novelwriter/assets/icons/fallback/search-replace.svg diff --git a/nw/assets/icons/fallback/search.svg b/novelwriter/assets/icons/fallback/search.svg similarity index 100% rename from nw/assets/icons/fallback/search.svg rename to novelwriter/assets/icons/fallback/search.svg diff --git a/nw/assets/icons/fallback/search_cancel-dark.svg b/novelwriter/assets/icons/fallback/search_cancel-dark.svg similarity index 100% rename from nw/assets/icons/fallback/search_cancel-dark.svg rename to novelwriter/assets/icons/fallback/search_cancel-dark.svg diff --git a/nw/assets/icons/fallback/search_cancel.svg b/novelwriter/assets/icons/fallback/search_cancel.svg similarity index 100% rename from nw/assets/icons/fallback/search_cancel.svg rename to novelwriter/assets/icons/fallback/search_cancel.svg diff --git a/nw/assets/icons/fallback/search_case-dark.svg b/novelwriter/assets/icons/fallback/search_case-dark.svg similarity index 100% rename from nw/assets/icons/fallback/search_case-dark.svg rename to novelwriter/assets/icons/fallback/search_case-dark.svg diff --git a/nw/assets/icons/fallback/search_case.svg b/novelwriter/assets/icons/fallback/search_case.svg similarity index 100% rename from nw/assets/icons/fallback/search_case.svg rename to novelwriter/assets/icons/fallback/search_case.svg diff --git a/nw/assets/icons/fallback/search_loop-dark.svg b/novelwriter/assets/icons/fallback/search_loop-dark.svg similarity index 100% rename from nw/assets/icons/fallback/search_loop-dark.svg rename to novelwriter/assets/icons/fallback/search_loop-dark.svg diff --git a/nw/assets/icons/fallback/search_loop.svg b/novelwriter/assets/icons/fallback/search_loop.svg similarity index 100% rename from nw/assets/icons/fallback/search_loop.svg rename to novelwriter/assets/icons/fallback/search_loop.svg diff --git a/nw/assets/icons/fallback/search_preserve-dark.svg b/novelwriter/assets/icons/fallback/search_preserve-dark.svg similarity index 100% rename from nw/assets/icons/fallback/search_preserve-dark.svg rename to novelwriter/assets/icons/fallback/search_preserve-dark.svg diff --git a/nw/assets/icons/fallback/search_preserve.svg b/novelwriter/assets/icons/fallback/search_preserve.svg similarity index 100% rename from nw/assets/icons/fallback/search_preserve.svg rename to novelwriter/assets/icons/fallback/search_preserve.svg diff --git a/nw/assets/icons/fallback/search_project-dark.svg b/novelwriter/assets/icons/fallback/search_project-dark.svg similarity index 100% rename from nw/assets/icons/fallback/search_project-dark.svg rename to novelwriter/assets/icons/fallback/search_project-dark.svg diff --git a/nw/assets/icons/fallback/search_project.svg b/novelwriter/assets/icons/fallback/search_project.svg similarity index 100% rename from nw/assets/icons/fallback/search_project.svg rename to novelwriter/assets/icons/fallback/search_project.svg diff --git a/nw/assets/icons/fallback/search_regex-dark.svg b/novelwriter/assets/icons/fallback/search_regex-dark.svg similarity index 100% rename from nw/assets/icons/fallback/search_regex-dark.svg rename to novelwriter/assets/icons/fallback/search_regex-dark.svg diff --git a/nw/assets/icons/fallback/search_regex.svg b/novelwriter/assets/icons/fallback/search_regex.svg similarity index 100% rename from nw/assets/icons/fallback/search_regex.svg rename to novelwriter/assets/icons/fallback/search_regex.svg diff --git a/nw/assets/icons/fallback/search_word-dark.svg b/novelwriter/assets/icons/fallback/search_word-dark.svg similarity index 100% rename from nw/assets/icons/fallback/search_word-dark.svg rename to novelwriter/assets/icons/fallback/search_word-dark.svg diff --git a/nw/assets/icons/fallback/search_word.svg b/novelwriter/assets/icons/fallback/search_word.svg similarity index 100% rename from nw/assets/icons/fallback/search_word.svg rename to novelwriter/assets/icons/fallback/search_word.svg diff --git a/nw/assets/icons/fallback/settings-dark.svg b/novelwriter/assets/icons/fallback/settings-dark.svg similarity index 100% rename from nw/assets/icons/fallback/settings-dark.svg rename to novelwriter/assets/icons/fallback/settings-dark.svg diff --git a/nw/assets/icons/fallback/settings.svg b/novelwriter/assets/icons/fallback/settings.svg similarity index 100% rename from nw/assets/icons/fallback/settings.svg rename to novelwriter/assets/icons/fallback/settings.svg diff --git a/nw/assets/icons/fallback/status_idle-dark.svg b/novelwriter/assets/icons/fallback/status_idle-dark.svg similarity index 100% rename from nw/assets/icons/fallback/status_idle-dark.svg rename to novelwriter/assets/icons/fallback/status_idle-dark.svg diff --git a/nw/assets/icons/fallback/status_idle.svg b/novelwriter/assets/icons/fallback/status_idle.svg similarity index 100% rename from nw/assets/icons/fallback/status_idle.svg rename to novelwriter/assets/icons/fallback/status_idle.svg diff --git a/nw/assets/icons/fallback/status_lang-dark.svg b/novelwriter/assets/icons/fallback/status_lang-dark.svg similarity index 100% rename from nw/assets/icons/fallback/status_lang-dark.svg rename to novelwriter/assets/icons/fallback/status_lang-dark.svg diff --git a/nw/assets/icons/fallback/status_lang.svg b/novelwriter/assets/icons/fallback/status_lang.svg similarity index 100% rename from nw/assets/icons/fallback/status_lang.svg rename to novelwriter/assets/icons/fallback/status_lang.svg diff --git a/nw/assets/icons/fallback/status_lines-dark.svg b/novelwriter/assets/icons/fallback/status_lines-dark.svg similarity index 100% rename from nw/assets/icons/fallback/status_lines-dark.svg rename to novelwriter/assets/icons/fallback/status_lines-dark.svg diff --git a/nw/assets/icons/fallback/status_lines.svg b/novelwriter/assets/icons/fallback/status_lines.svg similarity index 100% rename from nw/assets/icons/fallback/status_lines.svg rename to novelwriter/assets/icons/fallback/status_lines.svg diff --git a/nw/assets/icons/fallback/status_stats-dark.svg b/novelwriter/assets/icons/fallback/status_stats-dark.svg similarity index 100% rename from nw/assets/icons/fallback/status_stats-dark.svg rename to novelwriter/assets/icons/fallback/status_stats-dark.svg diff --git a/nw/assets/icons/fallback/status_stats.svg b/novelwriter/assets/icons/fallback/status_stats.svg similarity index 100% rename from nw/assets/icons/fallback/status_stats.svg rename to novelwriter/assets/icons/fallback/status_stats.svg diff --git a/nw/assets/icons/fallback/status_time-dark.svg b/novelwriter/assets/icons/fallback/status_time-dark.svg similarity index 100% rename from nw/assets/icons/fallback/status_time-dark.svg rename to novelwriter/assets/icons/fallback/status_time-dark.svg diff --git a/nw/assets/icons/fallback/status_time.svg b/novelwriter/assets/icons/fallback/status_time.svg similarity index 100% rename from nw/assets/icons/fallback/status_time.svg rename to novelwriter/assets/icons/fallback/status_time.svg diff --git a/nw/assets/icons/fallback/sticky-off-dark.svg b/novelwriter/assets/icons/fallback/sticky-off-dark.svg similarity index 100% rename from nw/assets/icons/fallback/sticky-off-dark.svg rename to novelwriter/assets/icons/fallback/sticky-off-dark.svg diff --git a/nw/assets/icons/fallback/sticky-off.svg b/novelwriter/assets/icons/fallback/sticky-off.svg similarity index 100% rename from nw/assets/icons/fallback/sticky-off.svg rename to novelwriter/assets/icons/fallback/sticky-off.svg diff --git a/nw/assets/icons/fallback/sticky-on-dark.svg b/novelwriter/assets/icons/fallback/sticky-on-dark.svg similarity index 100% rename from nw/assets/icons/fallback/sticky-on-dark.svg rename to novelwriter/assets/icons/fallback/sticky-on-dark.svg diff --git a/nw/assets/icons/fallback/sticky-on.svg b/novelwriter/assets/icons/fallback/sticky-on.svg similarity index 100% rename from nw/assets/icons/fallback/sticky-on.svg rename to novelwriter/assets/icons/fallback/sticky-on.svg diff --git a/nw/assets/icons/novelwriter.ico b/novelwriter/assets/icons/novelwriter.ico similarity index 100% rename from nw/assets/icons/novelwriter.ico rename to novelwriter/assets/icons/novelwriter.ico diff --git a/nw/assets/icons/novelwriter.svg b/novelwriter/assets/icons/novelwriter.svg similarity index 100% rename from nw/assets/icons/novelwriter.svg rename to novelwriter/assets/icons/novelwriter.svg diff --git a/nw/assets/icons/system/icons.conf b/novelwriter/assets/icons/system/icons.conf similarity index 100% rename from nw/assets/icons/system/icons.conf rename to novelwriter/assets/icons/system/icons.conf diff --git a/nw/assets/icons/typicons_colour_dark/README.md b/novelwriter/assets/icons/typicons_colour_dark/README.md similarity index 100% rename from nw/assets/icons/typicons_colour_dark/README.md rename to novelwriter/assets/icons/typicons_colour_dark/README.md diff --git a/nw/assets/icons/typicons_colour_dark/arrow-maximise.svg b/novelwriter/assets/icons/typicons_colour_dark/arrow-maximise.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/arrow-maximise.svg rename to novelwriter/assets/icons/typicons_colour_dark/arrow-maximise.svg diff --git a/nw/assets/icons/typicons_colour_dark/arrow-minimise.svg b/novelwriter/assets/icons/typicons_colour_dark/arrow-minimise.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/arrow-minimise.svg rename to novelwriter/assets/icons/typicons_colour_dark/arrow-minimise.svg diff --git a/nw/assets/icons/typicons_colour_dark/at.svg b/novelwriter/assets/icons/typicons_colour_dark/at.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/at.svg rename to novelwriter/assets/icons/typicons_colour_dark/at.svg diff --git a/nw/assets/icons/typicons_colour_dark/backspace.svg b/novelwriter/assets/icons/typicons_colour_dark/backspace.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/backspace.svg rename to novelwriter/assets/icons/typicons_colour_dark/backspace.svg diff --git a/nw/assets/icons/typicons_colour_dark/book.svg b/novelwriter/assets/icons/typicons_colour_dark/book.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/book.svg rename to novelwriter/assets/icons/typicons_colour_dark/book.svg diff --git a/nw/assets/icons/typicons_colour_dark/bookmark.svg b/novelwriter/assets/icons/typicons_colour_dark/bookmark.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/bookmark.svg rename to novelwriter/assets/icons/typicons_colour_dark/bookmark.svg diff --git a/nw/assets/icons/typicons_colour_dark/calendar.svg b/novelwriter/assets/icons/typicons_colour_dark/calendar.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/calendar.svg rename to novelwriter/assets/icons/typicons_colour_dark/calendar.svg diff --git a/nw/assets/icons/typicons_colour_dark/cancel.svg b/novelwriter/assets/icons/typicons_colour_dark/cancel.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/cancel.svg rename to novelwriter/assets/icons/typicons_colour_dark/cancel.svg diff --git a/nw/assets/icons/typicons_colour_dark/chevron-left.svg b/novelwriter/assets/icons/typicons_colour_dark/chevron-left.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/chevron-left.svg rename to novelwriter/assets/icons/typicons_colour_dark/chevron-left.svg diff --git a/nw/assets/icons/typicons_colour_dark/chevron-right.svg b/novelwriter/assets/icons/typicons_colour_dark/chevron-right.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/chevron-right.svg rename to novelwriter/assets/icons/typicons_colour_dark/chevron-right.svg diff --git a/nw/assets/icons/typicons_colour_dark/delete.svg b/novelwriter/assets/icons/typicons_colour_dark/delete.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/delete.svg rename to novelwriter/assets/icons/typicons_colour_dark/delete.svg diff --git a/nw/assets/icons/typicons_colour_dark/document-chapter.svg b/novelwriter/assets/icons/typicons_colour_dark/document-chapter.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/document-chapter.svg rename to novelwriter/assets/icons/typicons_colour_dark/document-chapter.svg diff --git a/nw/assets/icons/typicons_colour_dark/document-note.svg b/novelwriter/assets/icons/typicons_colour_dark/document-note.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/document-note.svg rename to novelwriter/assets/icons/typicons_colour_dark/document-note.svg diff --git a/nw/assets/icons/typicons_colour_dark/document-scene.svg b/novelwriter/assets/icons/typicons_colour_dark/document-scene.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/document-scene.svg rename to novelwriter/assets/icons/typicons_colour_dark/document-scene.svg diff --git a/nw/assets/icons/typicons_colour_dark/document-text.svg b/novelwriter/assets/icons/typicons_colour_dark/document-text.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/document-text.svg rename to novelwriter/assets/icons/typicons_colour_dark/document-text.svg diff --git a/nw/assets/icons/typicons_colour_dark/document-title.svg b/novelwriter/assets/icons/typicons_colour_dark/document-title.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/document-title.svg rename to novelwriter/assets/icons/typicons_colour_dark/document-title.svg diff --git a/nw/assets/icons/typicons_colour_dark/download.svg b/novelwriter/assets/icons/typicons_colour_dark/download.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/download.svg rename to novelwriter/assets/icons/typicons_colour_dark/download.svg diff --git a/nw/assets/icons/typicons_colour_dark/flag.svg b/novelwriter/assets/icons/typicons_colour_dark/flag.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/flag.svg rename to novelwriter/assets/icons/typicons_colour_dark/flag.svg diff --git a/nw/assets/icons/typicons_colour_dark/folder.svg b/novelwriter/assets/icons/typicons_colour_dark/folder.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/folder.svg rename to novelwriter/assets/icons/typicons_colour_dark/folder.svg diff --git a/nw/assets/icons/typicons_colour_dark/globe.svg b/novelwriter/assets/icons/typicons_colour_dark/globe.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/globe.svg rename to novelwriter/assets/icons/typicons_colour_dark/globe.svg diff --git a/nw/assets/icons/typicons_colour_dark/hash.svg b/novelwriter/assets/icons/typicons_colour_dark/hash.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/hash.svg rename to novelwriter/assets/icons/typicons_colour_dark/hash.svg diff --git a/nw/assets/icons/typicons_colour_dark/heading0.svg b/novelwriter/assets/icons/typicons_colour_dark/heading0.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/heading0.svg rename to novelwriter/assets/icons/typicons_colour_dark/heading0.svg diff --git a/nw/assets/icons/typicons_colour_dark/heading1.svg b/novelwriter/assets/icons/typicons_colour_dark/heading1.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/heading1.svg rename to novelwriter/assets/icons/typicons_colour_dark/heading1.svg diff --git a/nw/assets/icons/typicons_colour_dark/heading2.svg b/novelwriter/assets/icons/typicons_colour_dark/heading2.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/heading2.svg rename to novelwriter/assets/icons/typicons_colour_dark/heading2.svg diff --git a/nw/assets/icons/typicons_colour_dark/heading3.svg b/novelwriter/assets/icons/typicons_colour_dark/heading3.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/heading3.svg rename to novelwriter/assets/icons/typicons_colour_dark/heading3.svg diff --git a/nw/assets/icons/typicons_colour_dark/heading4.svg b/novelwriter/assets/icons/typicons_colour_dark/heading4.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/heading4.svg rename to novelwriter/assets/icons/typicons_colour_dark/heading4.svg diff --git a/nw/assets/icons/typicons_colour_dark/icons.conf b/novelwriter/assets/icons/typicons_colour_dark/icons.conf similarity index 100% rename from nw/assets/icons/typicons_colour_dark/icons.conf rename to novelwriter/assets/icons/typicons_colour_dark/icons.conf diff --git a/nw/assets/icons/typicons_colour_dark/input-checked.svg b/novelwriter/assets/icons/typicons_colour_dark/input-checked.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/input-checked.svg rename to novelwriter/assets/icons/typicons_colour_dark/input-checked.svg diff --git a/nw/assets/icons/typicons_colour_dark/key.svg b/novelwriter/assets/icons/typicons_colour_dark/key.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/key.svg rename to novelwriter/assets/icons/typicons_colour_dark/key.svg diff --git a/nw/assets/icons/typicons_colour_dark/location.svg b/novelwriter/assets/icons/typicons_colour_dark/location.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/location.svg rename to novelwriter/assets/icons/typicons_colour_dark/location.svg diff --git a/nw/assets/icons/typicons_colour_dark/media-record-outline.svg b/novelwriter/assets/icons/typicons_colour_dark/media-record-outline.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/media-record-outline.svg rename to novelwriter/assets/icons/typicons_colour_dark/media-record-outline.svg diff --git a/nw/assets/icons/typicons_colour_dark/media-record.svg b/novelwriter/assets/icons/typicons_colour_dark/media-record.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/media-record.svg rename to novelwriter/assets/icons/typicons_colour_dark/media-record.svg diff --git a/nw/assets/icons/typicons_colour_dark/minus.svg b/novelwriter/assets/icons/typicons_colour_dark/minus.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/minus.svg rename to novelwriter/assets/icons/typicons_colour_dark/minus.svg diff --git a/nw/assets/icons/typicons_colour_dark/pencil.svg b/novelwriter/assets/icons/typicons_colour_dark/pencil.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/pencil.svg rename to novelwriter/assets/icons/typicons_colour_dark/pencil.svg diff --git a/nw/assets/icons/typicons_colour_dark/pin-outline.svg b/novelwriter/assets/icons/typicons_colour_dark/pin-outline.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/pin-outline.svg rename to novelwriter/assets/icons/typicons_colour_dark/pin-outline.svg diff --git a/nw/assets/icons/typicons_colour_dark/pin.svg b/novelwriter/assets/icons/typicons_colour_dark/pin.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/pin.svg rename to novelwriter/assets/icons/typicons_colour_dark/pin.svg diff --git a/nw/assets/icons/typicons_colour_dark/plus.svg b/novelwriter/assets/icons/typicons_colour_dark/plus.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/plus.svg rename to novelwriter/assets/icons/typicons_colour_dark/plus.svg diff --git a/nw/assets/icons/typicons_colour_dark/puzzle.svg b/novelwriter/assets/icons/typicons_colour_dark/puzzle.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/puzzle.svg rename to novelwriter/assets/icons/typicons_colour_dark/puzzle.svg diff --git a/nw/assets/icons/typicons_colour_dark/refresh.svg b/novelwriter/assets/icons/typicons_colour_dark/refresh.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/refresh.svg rename to novelwriter/assets/icons/typicons_colour_dark/refresh.svg diff --git a/nw/assets/icons/typicons_colour_dark/search-replace.svg b/novelwriter/assets/icons/typicons_colour_dark/search-replace.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/search-replace.svg rename to novelwriter/assets/icons/typicons_colour_dark/search-replace.svg diff --git a/nw/assets/icons/typicons_colour_dark/search.svg b/novelwriter/assets/icons/typicons_colour_dark/search.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/search.svg rename to novelwriter/assets/icons/typicons_colour_dark/search.svg diff --git a/nw/assets/icons/typicons_colour_dark/star.svg b/novelwriter/assets/icons/typicons_colour_dark/star.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/star.svg rename to novelwriter/assets/icons/typicons_colour_dark/star.svg diff --git a/nw/assets/icons/typicons_colour_dark/stopwatch.svg b/novelwriter/assets/icons/typicons_colour_dark/stopwatch.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/stopwatch.svg rename to novelwriter/assets/icons/typicons_colour_dark/stopwatch.svg diff --git a/nw/assets/icons/typicons_colour_dark/tick.svg b/novelwriter/assets/icons/typicons_colour_dark/tick.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/tick.svg rename to novelwriter/assets/icons/typicons_colour_dark/tick.svg diff --git a/nw/assets/icons/typicons_colour_dark/times.svg b/novelwriter/assets/icons/typicons_colour_dark/times.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/times.svg rename to novelwriter/assets/icons/typicons_colour_dark/times.svg diff --git a/nw/assets/icons/typicons_colour_dark/trash.svg b/novelwriter/assets/icons/typicons_colour_dark/trash.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/trash.svg rename to novelwriter/assets/icons/typicons_colour_dark/trash.svg diff --git a/nw/assets/icons/typicons_colour_dark/user.svg b/novelwriter/assets/icons/typicons_colour_dark/user.svg similarity index 100% rename from nw/assets/icons/typicons_colour_dark/user.svg rename to novelwriter/assets/icons/typicons_colour_dark/user.svg diff --git a/nw/assets/icons/typicons_colour_light/README.md b/novelwriter/assets/icons/typicons_colour_light/README.md similarity index 100% rename from nw/assets/icons/typicons_colour_light/README.md rename to novelwriter/assets/icons/typicons_colour_light/README.md diff --git a/nw/assets/icons/typicons_colour_light/arrow-maximise.svg b/novelwriter/assets/icons/typicons_colour_light/arrow-maximise.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/arrow-maximise.svg rename to novelwriter/assets/icons/typicons_colour_light/arrow-maximise.svg diff --git a/nw/assets/icons/typicons_colour_light/arrow-minimise.svg b/novelwriter/assets/icons/typicons_colour_light/arrow-minimise.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/arrow-minimise.svg rename to novelwriter/assets/icons/typicons_colour_light/arrow-minimise.svg diff --git a/nw/assets/icons/typicons_colour_light/at.svg b/novelwriter/assets/icons/typicons_colour_light/at.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/at.svg rename to novelwriter/assets/icons/typicons_colour_light/at.svg diff --git a/nw/assets/icons/typicons_colour_light/backspace.svg b/novelwriter/assets/icons/typicons_colour_light/backspace.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/backspace.svg rename to novelwriter/assets/icons/typicons_colour_light/backspace.svg diff --git a/nw/assets/icons/typicons_colour_light/book.svg b/novelwriter/assets/icons/typicons_colour_light/book.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/book.svg rename to novelwriter/assets/icons/typicons_colour_light/book.svg diff --git a/nw/assets/icons/typicons_colour_light/bookmark.svg b/novelwriter/assets/icons/typicons_colour_light/bookmark.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/bookmark.svg rename to novelwriter/assets/icons/typicons_colour_light/bookmark.svg diff --git a/nw/assets/icons/typicons_colour_light/calendar.svg b/novelwriter/assets/icons/typicons_colour_light/calendar.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/calendar.svg rename to novelwriter/assets/icons/typicons_colour_light/calendar.svg diff --git a/nw/assets/icons/typicons_colour_light/cancel.svg b/novelwriter/assets/icons/typicons_colour_light/cancel.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/cancel.svg rename to novelwriter/assets/icons/typicons_colour_light/cancel.svg diff --git a/nw/assets/icons/typicons_colour_light/chevron-left.svg b/novelwriter/assets/icons/typicons_colour_light/chevron-left.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/chevron-left.svg rename to novelwriter/assets/icons/typicons_colour_light/chevron-left.svg diff --git a/nw/assets/icons/typicons_colour_light/chevron-right.svg b/novelwriter/assets/icons/typicons_colour_light/chevron-right.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/chevron-right.svg rename to novelwriter/assets/icons/typicons_colour_light/chevron-right.svg diff --git a/nw/assets/icons/typicons_colour_light/delete.svg b/novelwriter/assets/icons/typicons_colour_light/delete.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/delete.svg rename to novelwriter/assets/icons/typicons_colour_light/delete.svg diff --git a/nw/assets/icons/typicons_colour_light/document-chapter.svg b/novelwriter/assets/icons/typicons_colour_light/document-chapter.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/document-chapter.svg rename to novelwriter/assets/icons/typicons_colour_light/document-chapter.svg diff --git a/nw/assets/icons/typicons_colour_light/document-note.svg b/novelwriter/assets/icons/typicons_colour_light/document-note.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/document-note.svg rename to novelwriter/assets/icons/typicons_colour_light/document-note.svg diff --git a/nw/assets/icons/typicons_colour_light/document-scene.svg b/novelwriter/assets/icons/typicons_colour_light/document-scene.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/document-scene.svg rename to novelwriter/assets/icons/typicons_colour_light/document-scene.svg diff --git a/nw/assets/icons/typicons_colour_light/document-text.svg b/novelwriter/assets/icons/typicons_colour_light/document-text.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/document-text.svg rename to novelwriter/assets/icons/typicons_colour_light/document-text.svg diff --git a/nw/assets/icons/typicons_colour_light/document-title.svg b/novelwriter/assets/icons/typicons_colour_light/document-title.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/document-title.svg rename to novelwriter/assets/icons/typicons_colour_light/document-title.svg diff --git a/nw/assets/icons/typicons_colour_light/download.svg b/novelwriter/assets/icons/typicons_colour_light/download.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/download.svg rename to novelwriter/assets/icons/typicons_colour_light/download.svg diff --git a/nw/assets/icons/typicons_colour_light/flag.svg b/novelwriter/assets/icons/typicons_colour_light/flag.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/flag.svg rename to novelwriter/assets/icons/typicons_colour_light/flag.svg diff --git a/nw/assets/icons/typicons_colour_light/folder.svg b/novelwriter/assets/icons/typicons_colour_light/folder.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/folder.svg rename to novelwriter/assets/icons/typicons_colour_light/folder.svg diff --git a/nw/assets/icons/typicons_colour_light/globe.svg b/novelwriter/assets/icons/typicons_colour_light/globe.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/globe.svg rename to novelwriter/assets/icons/typicons_colour_light/globe.svg diff --git a/nw/assets/icons/typicons_colour_light/hash.svg b/novelwriter/assets/icons/typicons_colour_light/hash.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/hash.svg rename to novelwriter/assets/icons/typicons_colour_light/hash.svg diff --git a/nw/assets/icons/typicons_colour_light/heading0.svg b/novelwriter/assets/icons/typicons_colour_light/heading0.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/heading0.svg rename to novelwriter/assets/icons/typicons_colour_light/heading0.svg diff --git a/nw/assets/icons/typicons_colour_light/heading1.svg b/novelwriter/assets/icons/typicons_colour_light/heading1.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/heading1.svg rename to novelwriter/assets/icons/typicons_colour_light/heading1.svg diff --git a/nw/assets/icons/typicons_colour_light/heading2.svg b/novelwriter/assets/icons/typicons_colour_light/heading2.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/heading2.svg rename to novelwriter/assets/icons/typicons_colour_light/heading2.svg diff --git a/nw/assets/icons/typicons_colour_light/heading3.svg b/novelwriter/assets/icons/typicons_colour_light/heading3.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/heading3.svg rename to novelwriter/assets/icons/typicons_colour_light/heading3.svg diff --git a/nw/assets/icons/typicons_colour_light/heading4.svg b/novelwriter/assets/icons/typicons_colour_light/heading4.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/heading4.svg rename to novelwriter/assets/icons/typicons_colour_light/heading4.svg diff --git a/nw/assets/icons/typicons_colour_light/icons.conf b/novelwriter/assets/icons/typicons_colour_light/icons.conf similarity index 100% rename from nw/assets/icons/typicons_colour_light/icons.conf rename to novelwriter/assets/icons/typicons_colour_light/icons.conf diff --git a/nw/assets/icons/typicons_colour_light/input-checked.svg b/novelwriter/assets/icons/typicons_colour_light/input-checked.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/input-checked.svg rename to novelwriter/assets/icons/typicons_colour_light/input-checked.svg diff --git a/nw/assets/icons/typicons_colour_light/key.svg b/novelwriter/assets/icons/typicons_colour_light/key.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/key.svg rename to novelwriter/assets/icons/typicons_colour_light/key.svg diff --git a/nw/assets/icons/typicons_colour_light/location.svg b/novelwriter/assets/icons/typicons_colour_light/location.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/location.svg rename to novelwriter/assets/icons/typicons_colour_light/location.svg diff --git a/nw/assets/icons/typicons_colour_light/media-record-outline.svg b/novelwriter/assets/icons/typicons_colour_light/media-record-outline.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/media-record-outline.svg rename to novelwriter/assets/icons/typicons_colour_light/media-record-outline.svg diff --git a/nw/assets/icons/typicons_colour_light/media-record.svg b/novelwriter/assets/icons/typicons_colour_light/media-record.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/media-record.svg rename to novelwriter/assets/icons/typicons_colour_light/media-record.svg diff --git a/nw/assets/icons/typicons_colour_light/minus.svg b/novelwriter/assets/icons/typicons_colour_light/minus.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/minus.svg rename to novelwriter/assets/icons/typicons_colour_light/minus.svg diff --git a/nw/assets/icons/typicons_colour_light/pencil.svg b/novelwriter/assets/icons/typicons_colour_light/pencil.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/pencil.svg rename to novelwriter/assets/icons/typicons_colour_light/pencil.svg diff --git a/nw/assets/icons/typicons_colour_light/pin-outline.svg b/novelwriter/assets/icons/typicons_colour_light/pin-outline.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/pin-outline.svg rename to novelwriter/assets/icons/typicons_colour_light/pin-outline.svg diff --git a/nw/assets/icons/typicons_colour_light/pin.svg b/novelwriter/assets/icons/typicons_colour_light/pin.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/pin.svg rename to novelwriter/assets/icons/typicons_colour_light/pin.svg diff --git a/nw/assets/icons/typicons_colour_light/plus.svg b/novelwriter/assets/icons/typicons_colour_light/plus.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/plus.svg rename to novelwriter/assets/icons/typicons_colour_light/plus.svg diff --git a/nw/assets/icons/typicons_colour_light/puzzle.svg b/novelwriter/assets/icons/typicons_colour_light/puzzle.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/puzzle.svg rename to novelwriter/assets/icons/typicons_colour_light/puzzle.svg diff --git a/nw/assets/icons/typicons_colour_light/refresh.svg b/novelwriter/assets/icons/typicons_colour_light/refresh.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/refresh.svg rename to novelwriter/assets/icons/typicons_colour_light/refresh.svg diff --git a/nw/assets/icons/typicons_colour_light/search-replace.svg b/novelwriter/assets/icons/typicons_colour_light/search-replace.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/search-replace.svg rename to novelwriter/assets/icons/typicons_colour_light/search-replace.svg diff --git a/nw/assets/icons/typicons_colour_light/search.svg b/novelwriter/assets/icons/typicons_colour_light/search.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/search.svg rename to novelwriter/assets/icons/typicons_colour_light/search.svg diff --git a/nw/assets/icons/typicons_colour_light/star.svg b/novelwriter/assets/icons/typicons_colour_light/star.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/star.svg rename to novelwriter/assets/icons/typicons_colour_light/star.svg diff --git a/nw/assets/icons/typicons_colour_light/stopwatch.svg b/novelwriter/assets/icons/typicons_colour_light/stopwatch.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/stopwatch.svg rename to novelwriter/assets/icons/typicons_colour_light/stopwatch.svg diff --git a/nw/assets/icons/typicons_colour_light/tick.svg b/novelwriter/assets/icons/typicons_colour_light/tick.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/tick.svg rename to novelwriter/assets/icons/typicons_colour_light/tick.svg diff --git a/nw/assets/icons/typicons_colour_light/times.svg b/novelwriter/assets/icons/typicons_colour_light/times.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/times.svg rename to novelwriter/assets/icons/typicons_colour_light/times.svg diff --git a/nw/assets/icons/typicons_colour_light/trash.svg b/novelwriter/assets/icons/typicons_colour_light/trash.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/trash.svg rename to novelwriter/assets/icons/typicons_colour_light/trash.svg diff --git a/nw/assets/icons/typicons_colour_light/user.svg b/novelwriter/assets/icons/typicons_colour_light/user.svg similarity index 100% rename from nw/assets/icons/typicons_colour_light/user.svg rename to novelwriter/assets/icons/typicons_colour_light/user.svg diff --git a/nw/assets/icons/typicons_grey_dark/README.md b/novelwriter/assets/icons/typicons_grey_dark/README.md similarity index 100% rename from nw/assets/icons/typicons_grey_dark/README.md rename to novelwriter/assets/icons/typicons_grey_dark/README.md diff --git a/nw/assets/icons/typicons_grey_dark/arrow-maximise.svg b/novelwriter/assets/icons/typicons_grey_dark/arrow-maximise.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/arrow-maximise.svg rename to novelwriter/assets/icons/typicons_grey_dark/arrow-maximise.svg diff --git a/nw/assets/icons/typicons_grey_dark/arrow-minimise.svg b/novelwriter/assets/icons/typicons_grey_dark/arrow-minimise.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/arrow-minimise.svg rename to novelwriter/assets/icons/typicons_grey_dark/arrow-minimise.svg diff --git a/nw/assets/icons/typicons_grey_dark/at.svg b/novelwriter/assets/icons/typicons_grey_dark/at.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/at.svg rename to novelwriter/assets/icons/typicons_grey_dark/at.svg diff --git a/nw/assets/icons/typicons_grey_dark/backspace.svg b/novelwriter/assets/icons/typicons_grey_dark/backspace.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/backspace.svg rename to novelwriter/assets/icons/typicons_grey_dark/backspace.svg diff --git a/nw/assets/icons/typicons_grey_dark/book.svg b/novelwriter/assets/icons/typicons_grey_dark/book.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/book.svg rename to novelwriter/assets/icons/typicons_grey_dark/book.svg diff --git a/nw/assets/icons/typicons_grey_dark/bookmark.svg b/novelwriter/assets/icons/typicons_grey_dark/bookmark.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/bookmark.svg rename to novelwriter/assets/icons/typicons_grey_dark/bookmark.svg diff --git a/nw/assets/icons/typicons_grey_dark/calendar.svg b/novelwriter/assets/icons/typicons_grey_dark/calendar.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/calendar.svg rename to novelwriter/assets/icons/typicons_grey_dark/calendar.svg diff --git a/nw/assets/icons/typicons_grey_dark/cancel.svg b/novelwriter/assets/icons/typicons_grey_dark/cancel.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/cancel.svg rename to novelwriter/assets/icons/typicons_grey_dark/cancel.svg diff --git a/nw/assets/icons/typicons_grey_dark/chevron-left.svg b/novelwriter/assets/icons/typicons_grey_dark/chevron-left.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/chevron-left.svg rename to novelwriter/assets/icons/typicons_grey_dark/chevron-left.svg diff --git a/nw/assets/icons/typicons_grey_dark/chevron-right.svg b/novelwriter/assets/icons/typicons_grey_dark/chevron-right.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/chevron-right.svg rename to novelwriter/assets/icons/typicons_grey_dark/chevron-right.svg diff --git a/nw/assets/icons/typicons_grey_dark/delete.svg b/novelwriter/assets/icons/typicons_grey_dark/delete.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/delete.svg rename to novelwriter/assets/icons/typicons_grey_dark/delete.svg diff --git a/nw/assets/icons/typicons_grey_dark/document-text.svg b/novelwriter/assets/icons/typicons_grey_dark/document-text.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/document-text.svg rename to novelwriter/assets/icons/typicons_grey_dark/document-text.svg diff --git a/nw/assets/icons/typicons_grey_dark/document-title.svg b/novelwriter/assets/icons/typicons_grey_dark/document-title.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/document-title.svg rename to novelwriter/assets/icons/typicons_grey_dark/document-title.svg diff --git a/nw/assets/icons/typicons_grey_dark/download.svg b/novelwriter/assets/icons/typicons_grey_dark/download.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/download.svg rename to novelwriter/assets/icons/typicons_grey_dark/download.svg diff --git a/nw/assets/icons/typicons_grey_dark/flag.svg b/novelwriter/assets/icons/typicons_grey_dark/flag.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/flag.svg rename to novelwriter/assets/icons/typicons_grey_dark/flag.svg diff --git a/nw/assets/icons/typicons_grey_dark/folder.svg b/novelwriter/assets/icons/typicons_grey_dark/folder.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/folder.svg rename to novelwriter/assets/icons/typicons_grey_dark/folder.svg diff --git a/nw/assets/icons/typicons_grey_dark/globe.svg b/novelwriter/assets/icons/typicons_grey_dark/globe.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/globe.svg rename to novelwriter/assets/icons/typicons_grey_dark/globe.svg diff --git a/nw/assets/icons/typicons_grey_dark/hash.svg b/novelwriter/assets/icons/typicons_grey_dark/hash.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/hash.svg rename to novelwriter/assets/icons/typicons_grey_dark/hash.svg diff --git a/nw/assets/icons/typicons_grey_dark/heading0.svg b/novelwriter/assets/icons/typicons_grey_dark/heading0.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/heading0.svg rename to novelwriter/assets/icons/typicons_grey_dark/heading0.svg diff --git a/nw/assets/icons/typicons_grey_dark/heading1.svg b/novelwriter/assets/icons/typicons_grey_dark/heading1.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/heading1.svg rename to novelwriter/assets/icons/typicons_grey_dark/heading1.svg diff --git a/nw/assets/icons/typicons_grey_dark/heading2.svg b/novelwriter/assets/icons/typicons_grey_dark/heading2.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/heading2.svg rename to novelwriter/assets/icons/typicons_grey_dark/heading2.svg diff --git a/nw/assets/icons/typicons_grey_dark/heading3.svg b/novelwriter/assets/icons/typicons_grey_dark/heading3.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/heading3.svg rename to novelwriter/assets/icons/typicons_grey_dark/heading3.svg diff --git a/nw/assets/icons/typicons_grey_dark/heading4.svg b/novelwriter/assets/icons/typicons_grey_dark/heading4.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/heading4.svg rename to novelwriter/assets/icons/typicons_grey_dark/heading4.svg diff --git a/nw/assets/icons/typicons_grey_dark/icons.conf b/novelwriter/assets/icons/typicons_grey_dark/icons.conf similarity index 100% rename from nw/assets/icons/typicons_grey_dark/icons.conf rename to novelwriter/assets/icons/typicons_grey_dark/icons.conf diff --git a/nw/assets/icons/typicons_grey_dark/input-checked.svg b/novelwriter/assets/icons/typicons_grey_dark/input-checked.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/input-checked.svg rename to novelwriter/assets/icons/typicons_grey_dark/input-checked.svg diff --git a/nw/assets/icons/typicons_grey_dark/key.svg b/novelwriter/assets/icons/typicons_grey_dark/key.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/key.svg rename to novelwriter/assets/icons/typicons_grey_dark/key.svg diff --git a/nw/assets/icons/typicons_grey_dark/location.svg b/novelwriter/assets/icons/typicons_grey_dark/location.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/location.svg rename to novelwriter/assets/icons/typicons_grey_dark/location.svg diff --git a/nw/assets/icons/typicons_grey_dark/media-record-outline.svg b/novelwriter/assets/icons/typicons_grey_dark/media-record-outline.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/media-record-outline.svg rename to novelwriter/assets/icons/typicons_grey_dark/media-record-outline.svg diff --git a/nw/assets/icons/typicons_grey_dark/media-record.svg b/novelwriter/assets/icons/typicons_grey_dark/media-record.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/media-record.svg rename to novelwriter/assets/icons/typicons_grey_dark/media-record.svg diff --git a/nw/assets/icons/typicons_grey_dark/minus.svg b/novelwriter/assets/icons/typicons_grey_dark/minus.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/minus.svg rename to novelwriter/assets/icons/typicons_grey_dark/minus.svg diff --git a/nw/assets/icons/typicons_grey_dark/pencil.svg b/novelwriter/assets/icons/typicons_grey_dark/pencil.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/pencil.svg rename to novelwriter/assets/icons/typicons_grey_dark/pencil.svg diff --git a/nw/assets/icons/typicons_grey_dark/pin-outline.svg b/novelwriter/assets/icons/typicons_grey_dark/pin-outline.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/pin-outline.svg rename to novelwriter/assets/icons/typicons_grey_dark/pin-outline.svg diff --git a/nw/assets/icons/typicons_grey_dark/pin.svg b/novelwriter/assets/icons/typicons_grey_dark/pin.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/pin.svg rename to novelwriter/assets/icons/typicons_grey_dark/pin.svg diff --git a/nw/assets/icons/typicons_grey_dark/plus.svg b/novelwriter/assets/icons/typicons_grey_dark/plus.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/plus.svg rename to novelwriter/assets/icons/typicons_grey_dark/plus.svg diff --git a/nw/assets/icons/typicons_grey_dark/puzzle.svg b/novelwriter/assets/icons/typicons_grey_dark/puzzle.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/puzzle.svg rename to novelwriter/assets/icons/typicons_grey_dark/puzzle.svg diff --git a/nw/assets/icons/typicons_grey_dark/refresh.svg b/novelwriter/assets/icons/typicons_grey_dark/refresh.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/refresh.svg rename to novelwriter/assets/icons/typicons_grey_dark/refresh.svg diff --git a/nw/assets/icons/typicons_grey_dark/search-replace.svg b/novelwriter/assets/icons/typicons_grey_dark/search-replace.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/search-replace.svg rename to novelwriter/assets/icons/typicons_grey_dark/search-replace.svg diff --git a/nw/assets/icons/typicons_grey_dark/search.svg b/novelwriter/assets/icons/typicons_grey_dark/search.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/search.svg rename to novelwriter/assets/icons/typicons_grey_dark/search.svg diff --git a/nw/assets/icons/typicons_grey_dark/star.svg b/novelwriter/assets/icons/typicons_grey_dark/star.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/star.svg rename to novelwriter/assets/icons/typicons_grey_dark/star.svg diff --git a/nw/assets/icons/typicons_grey_dark/stopwatch.svg b/novelwriter/assets/icons/typicons_grey_dark/stopwatch.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/stopwatch.svg rename to novelwriter/assets/icons/typicons_grey_dark/stopwatch.svg diff --git a/nw/assets/icons/typicons_grey_dark/tick.svg b/novelwriter/assets/icons/typicons_grey_dark/tick.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/tick.svg rename to novelwriter/assets/icons/typicons_grey_dark/tick.svg diff --git a/nw/assets/icons/typicons_grey_dark/times.svg b/novelwriter/assets/icons/typicons_grey_dark/times.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/times.svg rename to novelwriter/assets/icons/typicons_grey_dark/times.svg diff --git a/nw/assets/icons/typicons_grey_dark/trash.svg b/novelwriter/assets/icons/typicons_grey_dark/trash.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/trash.svg rename to novelwriter/assets/icons/typicons_grey_dark/trash.svg diff --git a/nw/assets/icons/typicons_grey_dark/user.svg b/novelwriter/assets/icons/typicons_grey_dark/user.svg similarity index 100% rename from nw/assets/icons/typicons_grey_dark/user.svg rename to novelwriter/assets/icons/typicons_grey_dark/user.svg diff --git a/nw/assets/icons/typicons_grey_light/README.md b/novelwriter/assets/icons/typicons_grey_light/README.md similarity index 100% rename from nw/assets/icons/typicons_grey_light/README.md rename to novelwriter/assets/icons/typicons_grey_light/README.md diff --git a/nw/assets/icons/typicons_grey_light/arrow-maximise.svg b/novelwriter/assets/icons/typicons_grey_light/arrow-maximise.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/arrow-maximise.svg rename to novelwriter/assets/icons/typicons_grey_light/arrow-maximise.svg diff --git a/nw/assets/icons/typicons_grey_light/arrow-minimise.svg b/novelwriter/assets/icons/typicons_grey_light/arrow-minimise.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/arrow-minimise.svg rename to novelwriter/assets/icons/typicons_grey_light/arrow-minimise.svg diff --git a/nw/assets/icons/typicons_grey_light/at.svg b/novelwriter/assets/icons/typicons_grey_light/at.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/at.svg rename to novelwriter/assets/icons/typicons_grey_light/at.svg diff --git a/nw/assets/icons/typicons_grey_light/backspace.svg b/novelwriter/assets/icons/typicons_grey_light/backspace.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/backspace.svg rename to novelwriter/assets/icons/typicons_grey_light/backspace.svg diff --git a/nw/assets/icons/typicons_grey_light/book.svg b/novelwriter/assets/icons/typicons_grey_light/book.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/book.svg rename to novelwriter/assets/icons/typicons_grey_light/book.svg diff --git a/nw/assets/icons/typicons_grey_light/bookmark.svg b/novelwriter/assets/icons/typicons_grey_light/bookmark.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/bookmark.svg rename to novelwriter/assets/icons/typicons_grey_light/bookmark.svg diff --git a/nw/assets/icons/typicons_grey_light/calendar.svg b/novelwriter/assets/icons/typicons_grey_light/calendar.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/calendar.svg rename to novelwriter/assets/icons/typicons_grey_light/calendar.svg diff --git a/nw/assets/icons/typicons_grey_light/cancel.svg b/novelwriter/assets/icons/typicons_grey_light/cancel.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/cancel.svg rename to novelwriter/assets/icons/typicons_grey_light/cancel.svg diff --git a/nw/assets/icons/typicons_grey_light/chevron-left.svg b/novelwriter/assets/icons/typicons_grey_light/chevron-left.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/chevron-left.svg rename to novelwriter/assets/icons/typicons_grey_light/chevron-left.svg diff --git a/nw/assets/icons/typicons_grey_light/chevron-right.svg b/novelwriter/assets/icons/typicons_grey_light/chevron-right.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/chevron-right.svg rename to novelwriter/assets/icons/typicons_grey_light/chevron-right.svg diff --git a/nw/assets/icons/typicons_grey_light/delete.svg b/novelwriter/assets/icons/typicons_grey_light/delete.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/delete.svg rename to novelwriter/assets/icons/typicons_grey_light/delete.svg diff --git a/nw/assets/icons/typicons_grey_light/document-text.svg b/novelwriter/assets/icons/typicons_grey_light/document-text.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/document-text.svg rename to novelwriter/assets/icons/typicons_grey_light/document-text.svg diff --git a/nw/assets/icons/typicons_grey_light/document-title.svg b/novelwriter/assets/icons/typicons_grey_light/document-title.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/document-title.svg rename to novelwriter/assets/icons/typicons_grey_light/document-title.svg diff --git a/nw/assets/icons/typicons_grey_light/download.svg b/novelwriter/assets/icons/typicons_grey_light/download.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/download.svg rename to novelwriter/assets/icons/typicons_grey_light/download.svg diff --git a/nw/assets/icons/typicons_grey_light/flag.svg b/novelwriter/assets/icons/typicons_grey_light/flag.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/flag.svg rename to novelwriter/assets/icons/typicons_grey_light/flag.svg diff --git a/nw/assets/icons/typicons_grey_light/folder.svg b/novelwriter/assets/icons/typicons_grey_light/folder.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/folder.svg rename to novelwriter/assets/icons/typicons_grey_light/folder.svg diff --git a/nw/assets/icons/typicons_grey_light/globe.svg b/novelwriter/assets/icons/typicons_grey_light/globe.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/globe.svg rename to novelwriter/assets/icons/typicons_grey_light/globe.svg diff --git a/nw/assets/icons/typicons_grey_light/hash.svg b/novelwriter/assets/icons/typicons_grey_light/hash.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/hash.svg rename to novelwriter/assets/icons/typicons_grey_light/hash.svg diff --git a/nw/assets/icons/typicons_grey_light/heading0.svg b/novelwriter/assets/icons/typicons_grey_light/heading0.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/heading0.svg rename to novelwriter/assets/icons/typicons_grey_light/heading0.svg diff --git a/nw/assets/icons/typicons_grey_light/heading1.svg b/novelwriter/assets/icons/typicons_grey_light/heading1.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/heading1.svg rename to novelwriter/assets/icons/typicons_grey_light/heading1.svg diff --git a/nw/assets/icons/typicons_grey_light/heading2.svg b/novelwriter/assets/icons/typicons_grey_light/heading2.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/heading2.svg rename to novelwriter/assets/icons/typicons_grey_light/heading2.svg diff --git a/nw/assets/icons/typicons_grey_light/heading3.svg b/novelwriter/assets/icons/typicons_grey_light/heading3.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/heading3.svg rename to novelwriter/assets/icons/typicons_grey_light/heading3.svg diff --git a/nw/assets/icons/typicons_grey_light/heading4.svg b/novelwriter/assets/icons/typicons_grey_light/heading4.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/heading4.svg rename to novelwriter/assets/icons/typicons_grey_light/heading4.svg diff --git a/nw/assets/icons/typicons_grey_light/icons.conf b/novelwriter/assets/icons/typicons_grey_light/icons.conf similarity index 100% rename from nw/assets/icons/typicons_grey_light/icons.conf rename to novelwriter/assets/icons/typicons_grey_light/icons.conf diff --git a/nw/assets/icons/typicons_grey_light/input-checked.svg b/novelwriter/assets/icons/typicons_grey_light/input-checked.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/input-checked.svg rename to novelwriter/assets/icons/typicons_grey_light/input-checked.svg diff --git a/nw/assets/icons/typicons_grey_light/key.svg b/novelwriter/assets/icons/typicons_grey_light/key.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/key.svg rename to novelwriter/assets/icons/typicons_grey_light/key.svg diff --git a/nw/assets/icons/typicons_grey_light/location.svg b/novelwriter/assets/icons/typicons_grey_light/location.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/location.svg rename to novelwriter/assets/icons/typicons_grey_light/location.svg diff --git a/nw/assets/icons/typicons_grey_light/media-record-outline.svg b/novelwriter/assets/icons/typicons_grey_light/media-record-outline.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/media-record-outline.svg rename to novelwriter/assets/icons/typicons_grey_light/media-record-outline.svg diff --git a/nw/assets/icons/typicons_grey_light/media-record.svg b/novelwriter/assets/icons/typicons_grey_light/media-record.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/media-record.svg rename to novelwriter/assets/icons/typicons_grey_light/media-record.svg diff --git a/nw/assets/icons/typicons_grey_light/minus.svg b/novelwriter/assets/icons/typicons_grey_light/minus.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/minus.svg rename to novelwriter/assets/icons/typicons_grey_light/minus.svg diff --git a/nw/assets/icons/typicons_grey_light/pencil.svg b/novelwriter/assets/icons/typicons_grey_light/pencil.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/pencil.svg rename to novelwriter/assets/icons/typicons_grey_light/pencil.svg diff --git a/nw/assets/icons/typicons_grey_light/pin-outline.svg b/novelwriter/assets/icons/typicons_grey_light/pin-outline.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/pin-outline.svg rename to novelwriter/assets/icons/typicons_grey_light/pin-outline.svg diff --git a/nw/assets/icons/typicons_grey_light/pin.svg b/novelwriter/assets/icons/typicons_grey_light/pin.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/pin.svg rename to novelwriter/assets/icons/typicons_grey_light/pin.svg diff --git a/nw/assets/icons/typicons_grey_light/plus.svg b/novelwriter/assets/icons/typicons_grey_light/plus.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/plus.svg rename to novelwriter/assets/icons/typicons_grey_light/plus.svg diff --git a/nw/assets/icons/typicons_grey_light/puzzle.svg b/novelwriter/assets/icons/typicons_grey_light/puzzle.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/puzzle.svg rename to novelwriter/assets/icons/typicons_grey_light/puzzle.svg diff --git a/nw/assets/icons/typicons_grey_light/refresh.svg b/novelwriter/assets/icons/typicons_grey_light/refresh.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/refresh.svg rename to novelwriter/assets/icons/typicons_grey_light/refresh.svg diff --git a/nw/assets/icons/typicons_grey_light/search-replace.svg b/novelwriter/assets/icons/typicons_grey_light/search-replace.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/search-replace.svg rename to novelwriter/assets/icons/typicons_grey_light/search-replace.svg diff --git a/nw/assets/icons/typicons_grey_light/search.svg b/novelwriter/assets/icons/typicons_grey_light/search.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/search.svg rename to novelwriter/assets/icons/typicons_grey_light/search.svg diff --git a/nw/assets/icons/typicons_grey_light/star.svg b/novelwriter/assets/icons/typicons_grey_light/star.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/star.svg rename to novelwriter/assets/icons/typicons_grey_light/star.svg diff --git a/nw/assets/icons/typicons_grey_light/stopwatch.svg b/novelwriter/assets/icons/typicons_grey_light/stopwatch.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/stopwatch.svg rename to novelwriter/assets/icons/typicons_grey_light/stopwatch.svg diff --git a/nw/assets/icons/typicons_grey_light/tick.svg b/novelwriter/assets/icons/typicons_grey_light/tick.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/tick.svg rename to novelwriter/assets/icons/typicons_grey_light/tick.svg diff --git a/nw/assets/icons/typicons_grey_light/times.svg b/novelwriter/assets/icons/typicons_grey_light/times.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/times.svg rename to novelwriter/assets/icons/typicons_grey_light/times.svg diff --git a/nw/assets/icons/typicons_grey_light/trash.svg b/novelwriter/assets/icons/typicons_grey_light/trash.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/trash.svg rename to novelwriter/assets/icons/typicons_grey_light/trash.svg diff --git a/nw/assets/icons/typicons_grey_light/user.svg b/novelwriter/assets/icons/typicons_grey_light/user.svg similarity index 100% rename from nw/assets/icons/typicons_grey_light/user.svg rename to novelwriter/assets/icons/typicons_grey_light/user.svg diff --git a/nw/assets/icons/x-novelwriter-project.ico b/novelwriter/assets/icons/x-novelwriter-project.ico similarity index 100% rename from nw/assets/icons/x-novelwriter-project.ico rename to novelwriter/assets/icons/x-novelwriter-project.ico diff --git a/nw/assets/icons/x-novelwriter-project.svg b/novelwriter/assets/icons/x-novelwriter-project.svg similarity index 100% rename from nw/assets/icons/x-novelwriter-project.svg rename to novelwriter/assets/icons/x-novelwriter-project.svg diff --git a/nw/assets/images/wizard-back.jpg b/novelwriter/assets/images/wizard-back.jpg similarity index 100% rename from nw/assets/images/wizard-back.jpg rename to novelwriter/assets/images/wizard-back.jpg diff --git a/nw/assets/text/gplv3_en.htm b/novelwriter/assets/text/gplv3_en.htm similarity index 100% rename from nw/assets/text/gplv3_en.htm rename to novelwriter/assets/text/gplv3_en.htm diff --git a/nw/assets/text/release_notes.htm b/novelwriter/assets/text/release_notes.htm similarity index 100% rename from nw/assets/text/release_notes.htm rename to novelwriter/assets/text/release_notes.htm diff --git a/nw/assets/text/release_notes_1.0.htm b/novelwriter/assets/text/release_notes_1.0.htm similarity index 100% rename from nw/assets/text/release_notes_1.0.htm rename to novelwriter/assets/text/release_notes_1.0.htm diff --git a/nw/assets/text/release_notes_1.1.htm b/novelwriter/assets/text/release_notes_1.1.htm similarity index 100% rename from nw/assets/text/release_notes_1.1.htm rename to novelwriter/assets/text/release_notes_1.1.htm diff --git a/nw/assets/text/release_notes_1.2.htm b/novelwriter/assets/text/release_notes_1.2.htm similarity index 100% rename from nw/assets/text/release_notes_1.2.htm rename to novelwriter/assets/text/release_notes_1.2.htm diff --git a/nw/assets/text/release_notes_1.3.htm b/novelwriter/assets/text/release_notes_1.3.htm similarity index 100% rename from nw/assets/text/release_notes_1.3.htm rename to novelwriter/assets/text/release_notes_1.3.htm diff --git a/nw/assets/text/release_notes_1.4.htm b/novelwriter/assets/text/release_notes_1.4.htm similarity index 100% rename from nw/assets/text/release_notes_1.4.htm rename to novelwriter/assets/text/release_notes_1.4.htm diff --git a/nw/assets/themes/gui/default/theme.conf b/novelwriter/assets/themes/gui/default/theme.conf similarity index 100% rename from nw/assets/themes/gui/default/theme.conf rename to novelwriter/assets/themes/gui/default/theme.conf diff --git a/nw/assets/themes/gui/default_dark/styles.qss b/novelwriter/assets/themes/gui/default_dark/styles.qss similarity index 100% rename from nw/assets/themes/gui/default_dark/styles.qss rename to novelwriter/assets/themes/gui/default_dark/styles.qss diff --git a/nw/assets/themes/gui/default_dark/theme.conf b/novelwriter/assets/themes/gui/default_dark/theme.conf similarity index 100% rename from nw/assets/themes/gui/default_dark/theme.conf rename to novelwriter/assets/themes/gui/default_dark/theme.conf diff --git a/nw/assets/themes/gui/solarized_dark/theme.conf b/novelwriter/assets/themes/gui/solarized_dark/theme.conf similarity index 100% rename from nw/assets/themes/gui/solarized_dark/theme.conf rename to novelwriter/assets/themes/gui/solarized_dark/theme.conf diff --git a/nw/assets/themes/gui/solarized_light/theme.conf b/novelwriter/assets/themes/gui/solarized_light/theme.conf similarity index 100% rename from nw/assets/themes/gui/solarized_light/theme.conf rename to novelwriter/assets/themes/gui/solarized_light/theme.conf diff --git a/nw/assets/themes/syntax/default_dark.conf b/novelwriter/assets/themes/syntax/default_dark.conf similarity index 100% rename from nw/assets/themes/syntax/default_dark.conf rename to novelwriter/assets/themes/syntax/default_dark.conf diff --git a/nw/assets/themes/syntax/default_light.conf b/novelwriter/assets/themes/syntax/default_light.conf similarity index 100% rename from nw/assets/themes/syntax/default_light.conf rename to novelwriter/assets/themes/syntax/default_light.conf diff --git a/nw/assets/themes/syntax/grey_dark.conf b/novelwriter/assets/themes/syntax/grey_dark.conf similarity index 100% rename from nw/assets/themes/syntax/grey_dark.conf rename to novelwriter/assets/themes/syntax/grey_dark.conf diff --git a/nw/assets/themes/syntax/grey_light.conf b/novelwriter/assets/themes/syntax/grey_light.conf similarity index 100% rename from nw/assets/themes/syntax/grey_light.conf rename to novelwriter/assets/themes/syntax/grey_light.conf diff --git a/nw/assets/themes/syntax/light_owl.conf b/novelwriter/assets/themes/syntax/light_owl.conf similarity index 100% rename from nw/assets/themes/syntax/light_owl.conf rename to novelwriter/assets/themes/syntax/light_owl.conf diff --git a/nw/assets/themes/syntax/night_owl.conf b/novelwriter/assets/themes/syntax/night_owl.conf similarity index 100% rename from nw/assets/themes/syntax/night_owl.conf rename to novelwriter/assets/themes/syntax/night_owl.conf diff --git a/nw/assets/themes/syntax/solarized_dark.conf b/novelwriter/assets/themes/syntax/solarized_dark.conf similarity index 100% rename from nw/assets/themes/syntax/solarized_dark.conf rename to novelwriter/assets/themes/syntax/solarized_dark.conf diff --git a/nw/assets/themes/syntax/solarized_light.conf b/novelwriter/assets/themes/syntax/solarized_light.conf similarity index 100% rename from nw/assets/themes/syntax/solarized_light.conf rename to novelwriter/assets/themes/syntax/solarized_light.conf diff --git a/nw/assets/themes/syntax/tomorrow.conf b/novelwriter/assets/themes/syntax/tomorrow.conf similarity index 100% rename from nw/assets/themes/syntax/tomorrow.conf rename to novelwriter/assets/themes/syntax/tomorrow.conf diff --git a/nw/assets/themes/syntax/tomorrow_night.conf b/novelwriter/assets/themes/syntax/tomorrow_night.conf similarity index 100% rename from nw/assets/themes/syntax/tomorrow_night.conf rename to novelwriter/assets/themes/syntax/tomorrow_night.conf diff --git a/nw/assets/themes/syntax/tomorrow_night_blue.conf b/novelwriter/assets/themes/syntax/tomorrow_night_blue.conf similarity index 100% rename from nw/assets/themes/syntax/tomorrow_night_blue.conf rename to novelwriter/assets/themes/syntax/tomorrow_night_blue.conf diff --git a/nw/assets/themes/syntax/tomorrow_night_bright.conf b/novelwriter/assets/themes/syntax/tomorrow_night_bright.conf similarity index 100% rename from nw/assets/themes/syntax/tomorrow_night_bright.conf rename to novelwriter/assets/themes/syntax/tomorrow_night_bright.conf diff --git a/nw/assets/themes/syntax/tomorrow_night_eighties.conf b/novelwriter/assets/themes/syntax/tomorrow_night_eighties.conf similarity index 100% rename from nw/assets/themes/syntax/tomorrow_night_eighties.conf rename to novelwriter/assets/themes/syntax/tomorrow_night_eighties.conf diff --git a/nw/common.py b/novelwriter/common.py similarity index 98% rename from nw/common.py rename to novelwriter/common.py index 5029268c..da61c8b8 100644 --- a/nw/common.py +++ b/novelwriter/common.py @@ -32,9 +32,9 @@ from configparser import ConfigParser from PyQt5.QtWidgets import qApp from PyQt5.QtCore import QCoreApplication -from nw.enum import nwItemClass, nwItemType, nwItemLayout -from nw.error import logException -from nw.constants import nwConst, nwUnicode +from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout +from novelwriter.error import logException +from novelwriter.constants import nwConst, nwUnicode logger = logging.getLogger(__name__) diff --git a/nw/config.py b/novelwriter/config.py similarity index 98% rename from nw/config.py rename to novelwriter/config.py index 5d49ecd0..42bbe5d3 100644 --- a/nw/config.py +++ b/novelwriter/config.py @@ -36,9 +36,9 @@ from PyQt5.QtCore import ( QTranslator ) -from nw.error import logException -from nw.common import splitVersionNumber, formatTimeStamp, NWConfigParser -from nw.constants import nwConst, nwFiles, nwUnicode +from novelwriter.error import logException +from novelwriter.common import splitVersionNumber, formatTimeStamp, NWConfigParser +from novelwriter.constants import nwConst, nwFiles, nwUnicode logger = logging.getLogger(__name__) @@ -67,10 +67,10 @@ class Config: self.appPath = None # The full path to the novelwriter package folder self.appRoot = None # The full path to the novelwriter root folder self.appIcon = None # The full path to the novelwriter icon file - self.assetPath = None # The full path to the nw/assets folder - self.themeRoot = None # The full path to the nw/assets/themes folder - self.dictPath = None # The full path to the nw/assets/dict folder - self.iconPath = None # The full path to the nw/assets/icons folder + self.assetPath = None # The full path to the novelwriter/assets folder + self.themeRoot = None # The full path to the novelwriter/assets/themes folder + self.dictPath = None # The full path to the novelwriter/assets/dict folder + self.iconPath = None # The full path to the novelwriter/assets/icons folder self.pdfDocs = None # The location of the PDF manual, if it exists # Runtime Settings and Variables diff --git a/nw/constants.py b/novelwriter/constants.py similarity index 99% rename from nw/constants.py rename to novelwriter/constants.py index 9f7ff031..6a44e7a0 100644 --- a/nw/constants.py +++ b/novelwriter/constants.py @@ -25,7 +25,7 @@ along with this program. If not, see . from PyQt5.QtCore import QCoreApplication, QT_TRANSLATE_NOOP -from nw.enum import nwItemClass, nwItemLayout, nwItemType, nwOutline +from novelwriter.enum import nwItemClass, nwItemLayout, nwItemType, nwOutline def trConst(tString): diff --git a/nw/core/__init__.py b/novelwriter/core/__init__.py similarity index 72% rename from nw/core/__init__.py rename to novelwriter/core/__init__.py index 540e2abd..9ded84e9 100644 --- a/nw/core/__init__.py +++ b/novelwriter/core/__init__.py @@ -19,13 +19,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -from nw.core.document import NWDoc -from nw.core.index import NWIndex, countWords -from nw.core.project import NWProject -from nw.core.spellcheck import NWSpellCheck, NWSpellEnchant, NWSpellSimple -from nw.core.tohtml import ToHtml -from nw.core.toodt import ToOdt -from nw.core.tomd import ToMarkdown +from novelwriter.core.document import NWDoc +from novelwriter.core.index import NWIndex, countWords +from novelwriter.core.project import NWProject +from novelwriter.core.spellcheck import NWSpellCheck, NWSpellEnchant, NWSpellSimple +from novelwriter.core.tohtml import ToHtml +from novelwriter.core.toodt import ToOdt +from novelwriter.core.tomd import ToMarkdown __all__ = [ "countWords", diff --git a/nw/core/document.py b/novelwriter/core/document.py similarity index 98% rename from nw/core/document.py rename to novelwriter/core/document.py index 7ec2d6c6..4726a8fb 100644 --- a/nw/core/document.py +++ b/novelwriter/core/document.py @@ -23,11 +23,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import logging import os +import logging -from nw.enum import nwItemLayout, nwItemClass -from nw.common import isHandle +from novelwriter.enum import nwItemLayout, nwItemClass +from novelwriter.common import isHandle logger = logging.getLogger(__name__) diff --git a/nw/core/index.py b/novelwriter/core/index.py similarity index 98% rename from nw/core/index.py rename to novelwriter/core/index.py index 1a49cb6b..55839ff4 100644 --- a/nw/core/index.py +++ b/novelwriter/core/index.py @@ -24,17 +24,17 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw -import logging -import json import os +import json +import logging +import novelwriter from time import time -from nw.enum import nwItemType, nwItemClass, nwItemLayout -from nw.constants import nwFiles, nwKeyWords, nwUnicode -from nw.core.document import NWDoc -from nw.common import ( +from novelwriter.enum import nwItemType, nwItemClass, nwItemLayout +from novelwriter.constants import nwFiles, nwKeyWords, nwUnicode +from novelwriter.core.document import NWDoc +from novelwriter.common import ( isHandle, isTitleTag, isItemClass, isItemLayout, jsonEncode ) @@ -49,7 +49,7 @@ class NWIndex(): def __init__(self, theProject): # Internal - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theProject = theProject self.indexBroken = False @@ -155,7 +155,7 @@ class NWIndex(): except Exception: logger.error("Failed to load index file") - nw.logException() + novelwriter.logException() self.indexBroken = True return False @@ -194,7 +194,7 @@ class NWIndex(): except Exception: logger.error("Failed to save index file") - nw.logException() + novelwriter.logException() return False logger.verbose("Index saved in %.3f ms", (time() - tStart)*1000) @@ -217,7 +217,7 @@ class NWIndex(): except Exception: logger.error("Error while checking index") - nw.logException() + novelwriter.logException() self.indexBroken = True logger.verbose("Index check took %.3f ms", (time() - tStart)*1000) diff --git a/nw/core/item.py b/novelwriter/core/item.py similarity index 97% rename from nw/core/item.py rename to novelwriter/core/item.py index 6be51f27..3170c6cd 100644 --- a/nw/core/item.py +++ b/novelwriter/core/item.py @@ -27,9 +27,11 @@ import logging from lxml import etree -from nw.enum import nwItemType, nwItemClass, nwItemLayout -from nw.common import checkInt, isHandle, isItemClass, isItemLayout, isItemType -from nw.constants import nwLabels, nwLists, trConst +from novelwriter.enum import nwItemType, nwItemClass, nwItemLayout +from novelwriter.common import ( + checkInt, isHandle, isItemClass, isItemLayout, isItemType +) +from novelwriter.constants import nwLabels, nwLists, trConst logger = logging.getLogger(__name__) diff --git a/nw/core/options.py b/novelwriter/core/options.py similarity index 98% rename from nw/core/options.py rename to novelwriter/core/options.py index a32bf3f2..3526d4f8 100644 --- a/nw/core/options.py +++ b/novelwriter/core/options.py @@ -24,12 +24,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw -import logging -import json import os +import json +import logging +import novelwriter -from nw.constants import nwFiles +from novelwriter.constants import nwFiles logger = logging.getLogger(__name__) @@ -134,7 +134,7 @@ class OptionState(): theState = json.load(inFile) except Exception: logger.error("Failed to load GUI options file") - nw.logException() + novelwriter.logException() return False # Filter out unused variables @@ -161,7 +161,7 @@ class OptionState(): json.dump(self.theState, outFile, indent=2) except Exception: logger.error("Failed to save GUI options file") - nw.logException() + novelwriter.logException() return False return True diff --git a/nw/core/project.py b/novelwriter/core/project.py similarity index 98% rename from nw/core/project.py rename to novelwriter/core/project.py index 81c9bdeb..401accc6 100644 --- a/nw/core/project.py +++ b/novelwriter/core/project.py @@ -23,29 +23,29 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw -import logging import os import json import shutil +import logging +import novelwriter -from lxml import etree from time import time +from lxml import etree from functools import partial from PyQt5.QtCore import QCoreApplication -from nw.core.tree import NWTree -from nw.core.item import NWItem -from nw.core.document import NWDoc -from nw.core.status import NWStatus -from nw.core.options import OptionState -from nw.common import ( +from novelwriter.core.tree import NWTree +from novelwriter.core.item import NWItem +from novelwriter.core.document import NWDoc +from novelwriter.core.status import NWStatus +from novelwriter.core.options import OptionState +from novelwriter.common import ( checkString, checkBool, checkInt, isHandle, formatTimeStamp, makeFileNameSafe, hexToInt ) -from nw.enum import nwItemType, nwItemClass, nwItemLayout, nwAlert -from nw.constants import trConst, nwFiles, nwLabels +from novelwriter.enum import nwItemType, nwItemClass, nwItemLayout, nwAlert +from novelwriter.constants import trConst, nwFiles, nwLabels logger = logging.getLogger(__name__) @@ -58,7 +58,7 @@ class NWProject(): # Internal self.theParent = theParent - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG # Core Elements self.optState = OptionState(self) # Project-specific GUI options @@ -485,7 +485,7 @@ class NWProject(): "The file format of your project is about to be updated. " "If you proceed, this project can no longer be opened by " "an older version of novelWriter. Continue?" - ).format(appVersion, nw.__version__) + ).format(appVersion, novelwriter.__version__) ) if not msgYes: self.clearProject() @@ -504,7 +504,7 @@ class NWProject(): # Check novelWriter Version # ========================= - if hexToInt(hexVersion) > hexToInt(nw.__hexversion__): + if hexToInt(hexVersion) > hexToInt(novelwriter.__hexversion__): msgYes = self.theParent.askQuestion( self.tr("Version Conflict"), self.tr( @@ -513,7 +513,7 @@ class NWProject(): "continue to open the project, some attributes and " "settings may not be preserved, but the overall project " "should be fine. Continue opening the project?" - ).format(appVersion, nw.__version__) + ).format(appVersion, novelwriter.__version__) ) if not msgYes: self.clearProject() @@ -646,8 +646,8 @@ class NWProject(): # Root element and project details logger.debug("Writing project meta") nwXML = etree.Element("novelWriterXML", attrib={ - "appVersion": str(nw.__version__), - "hexVersion": str(nw.__hexversion__), + "appVersion": str(novelwriter.__version__), + "hexVersion": str(novelwriter.__hexversion__), "fileVersion": self.FILE_VERSION, "timeStamp": formatTimeStamp(saveTime), }) @@ -1252,7 +1252,7 @@ class NWProject(): except Exception: logger.error("Failed to project language file") - nw.logException() + novelwriter.logException() return False return True @@ -1277,7 +1277,7 @@ class NWProject(): except Exception: logger.error("Failed to read project lockfile") - nw.logException() + novelwriter.logException() return ["ERROR"] return theLines @@ -1298,7 +1298,7 @@ class NWProject(): except Exception: logger.error("Failed to write project lockfile") - nw.logException() + novelwriter.logException() return False return True @@ -1315,7 +1315,7 @@ class NWProject(): os.unlink(lockFile) except Exception: logger.error("Failed to remove project lockfile") - nw.logException() + novelwriter.logException() return False return True @@ -1488,7 +1488,7 @@ class NWProject(): except Exception: logger.error("Failed to write session stats file") - nw.logException() + novelwriter.logException() return False return True @@ -1526,7 +1526,7 @@ class NWProject(): except Exception: errList.append(self.tr("Could not move: {0}").format(theFile)) logger.error("Could not move: %s", theFile) - nw.logException() + novelwriter.logException() elif len(dataItem) == 21 and dataItem.endswith("_main.bak"): try: @@ -1535,7 +1535,7 @@ class NWProject(): except Exception: errList.append(self.tr("Could not delete: {0}").format(theFile)) logger.error("Could not delete: %s", theFile) - nw.logException() + novelwriter.logException() else: theErr = self._moveUnknownItem(theData, dataItem) @@ -1549,7 +1549,7 @@ class NWProject(): except Exception: errList.append(self.tr("Could not delete: {0}").format(theFolder)) logger.error("Could not delete: %s", theFolder) - nw.logException() + novelwriter.logException() return errList @@ -1569,7 +1569,7 @@ class NWProject(): logger.info("Moved to junk: %s", theSrc) except Exception: logger.error("Could not move item %s to junk", theSrc) - nw.logException() + novelwriter.logException() return self.tr("Could not move item {0} to {1}.").format(theSrc, theJunk) return "" @@ -1604,7 +1604,7 @@ class NWProject(): os.unlink(rmFile) except Exception: logger.error("Could not delete: %s", rmFile) - nw.logException() + novelwriter.logException() return False return True diff --git a/nw/core/spellcheck.py b/novelwriter/core/spellcheck.py similarity index 97% rename from nw/core/spellcheck.py rename to novelwriter/core/spellcheck.py index 66bbd08a..0e49e0e9 100644 --- a/nw/core/spellcheck.py +++ b/novelwriter/core/spellcheck.py @@ -23,10 +23,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw -import logging import os import difflib +import logging +import novelwriter logger = logging.getLogger(__name__) @@ -41,7 +41,7 @@ class NWSpellCheck(): projDict = [] def __init__(self): - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.projectDict = None self.spellLanguage = None return @@ -72,7 +72,7 @@ class NWSpellCheck(): self.projDict.append(newWord) except Exception: logger.error("Failed to add word to project word list %s", str(self.projectDict)) - nw.logException() + novelwriter.logException() return False return True return False @@ -115,7 +115,7 @@ class NWSpellCheck(): except Exception: logger.error("Failed to load project word list") - nw.logException() + novelwriter.logException() return False return True @@ -201,7 +201,7 @@ class NWSpellEnchant(NWSpellCheck): spName = self.theDict.provider.name except Exception: logger.error("Failed to extract information about the dictionary") - nw.logException() + novelwriter.logException() spTag = "" spName = "" @@ -264,7 +264,7 @@ class NWSpellSimple(NWSpellCheck): except Exception: logger.error("Failed to load spell check word list for language '%s'", theLang) - nw.logException() + novelwriter.logException() self.spellLanguage = None self._readProjectDictionary(projectDict) diff --git a/nw/core/status.py b/novelwriter/core/status.py similarity index 99% rename from nw/core/status.py rename to novelwriter/core/status.py index 57e56bd1..c52dc3ae 100644 --- a/nw/core/status.py +++ b/novelwriter/core/status.py @@ -27,7 +27,7 @@ import logging from lxml import etree -from nw.common import checkInt +from novelwriter.common import checkInt logger = logging.getLogger(__name__) diff --git a/nw/core/tohtml.py b/novelwriter/core/tohtml.py similarity index 99% rename from nw/core/tohtml.py rename to novelwriter/core/tohtml.py index 8039fc86..b6af70f3 100644 --- a/nw/core/tohtml.py +++ b/novelwriter/core/tohtml.py @@ -25,8 +25,8 @@ along with this program. If not, see . import logging -from nw.core.tokenizer import Tokenizer -from nw.constants import nwKeyWords, nwLabels, nwHtmlUnicode +from novelwriter.core.tokenizer import Tokenizer +from novelwriter.constants import nwKeyWords, nwLabels, nwHtmlUnicode logger = logging.getLogger(__name__) diff --git a/nw/core/tokenizer.py b/novelwriter/core/tokenizer.py similarity index 98% rename from nw/core/tokenizer.py rename to novelwriter/core/tokenizer.py index 344093f3..c4b1be5e 100644 --- a/nw/core/tokenizer.py +++ b/novelwriter/core/tokenizer.py @@ -23,19 +23,19 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import re import logging +import novelwriter from operator import itemgetter from functools import partial from PyQt5.QtCore import QCoreApplication, QRegularExpression -from nw.enum import nwItemLayout, nwItemType -from nw.common import numberToRoman, checkInt -from nw.constants import nwConst, nwRegEx, nwUnicode -from nw.core.document import NWDoc +from novelwriter.enum import nwItemLayout, nwItemType +from novelwriter.common import numberToRoman, checkInt +from novelwriter.constants import nwConst, nwRegEx, nwUnicode +from novelwriter.core.document import NWDoc logger = logging.getLogger(__name__) @@ -82,7 +82,7 @@ class Tokenizer(): self.theProject = theProject self.theParent = theProject.theParent - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG # Data Variables self.theText = "" # The raw text to be tokenized diff --git a/nw/core/tomd.py b/novelwriter/core/tomd.py similarity index 98% rename from nw/core/tomd.py rename to novelwriter/core/tomd.py index e27fef0b..3ac0f58f 100644 --- a/nw/core/tomd.py +++ b/novelwriter/core/tomd.py @@ -25,8 +25,8 @@ along with this program. If not, see . import logging -from nw.constants import nwLabels -from nw.core.tokenizer import Tokenizer +from novelwriter.constants import nwLabels +from novelwriter.core.tokenizer import Tokenizer logger = logging.getLogger(__name__) diff --git a/nw/core/toodt.py b/novelwriter/core/toodt.py similarity index 99% rename from nw/core/toodt.py rename to novelwriter/core/toodt.py index 152d2889..3529855d 100644 --- a/nw/core/toodt.py +++ b/novelwriter/core/toodt.py @@ -23,16 +23,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from lxml import etree from hashlib import sha256 from zipfile import ZipFile from datetime import datetime -from nw.constants import nwKeyWords, nwLabels -from nw.core.tokenizer import Tokenizer +from novelwriter.constants import nwKeyWords, nwLabels +from novelwriter.core.tokenizer import Tokenizer logger = logging.getLogger(__name__) @@ -74,8 +74,6 @@ class ToOdt(Tokenizer): def __init__(self, theProject, isFlat): Tokenizer.__init__(self, theProject) - self.mainConf = nw.CONFIG - self._isFlat = isFlat # Flat: .fodt, otherwise .odt self._dFlat = None # FODT file XML root @@ -318,7 +316,7 @@ class ToOdt(Tokenizer): xMeta.text = datetime.now().strftime("%Y-%m-%dT%H:%M:%S") xMeta = etree.SubElement(self._xMeta, _mkTag("meta", "generator")) - xMeta.text = f"novelWriter/{nw.__version__}" + xMeta.text = f"novelWriter/{novelwriter.__version__}" self._pageStyles() self._defaultStyles() diff --git a/nw/core/tree.py b/novelwriter/core/tree.py similarity index 98% rename from nw/core/tree.py rename to novelwriter/core/tree.py index e19fe585..0eeebdad 100644 --- a/nw/core/tree.py +++ b/novelwriter/core/tree.py @@ -23,18 +23,18 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import os import logging +import novelwriter from time import time from lxml import etree from hashlib import sha256 -from nw.enum import nwItemType, nwItemClass, nwItemLayout -from nw.common import checkHandle -from nw.constants import nwConst, nwFiles -from nw.core.item import NWItem +from novelwriter.enum import nwItemType, nwItemClass, nwItemLayout +from novelwriter.common import checkHandle +from novelwriter.constants import nwConst, nwFiles +from novelwriter.core.item import NWItem logger = logging.getLogger(__name__) @@ -184,7 +184,7 @@ class NWTree(): except Exception: logger.error("Could not write ToC file") - nw.logException() + novelwriter.logException() return False return True diff --git a/nw/dialogs/__init__.py b/novelwriter/dialogs/__init__.py similarity index 64% rename from nw/dialogs/__init__.py rename to novelwriter/dialogs/__init__.py index e278bbb9..b7a1dd46 100644 --- a/nw/dialogs/__init__.py +++ b/novelwriter/dialogs/__init__.py @@ -19,16 +19,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -from nw.dialogs.about import GuiAbout -from nw.dialogs.docmerge import GuiDocMerge -from nw.dialogs.docsplit import GuiDocSplit -from nw.dialogs.itemeditor import GuiItemEditor -from nw.dialogs.preferences import GuiPreferences -from nw.dialogs.projload import GuiProjectLoad -from nw.dialogs.projsettings import GuiProjectSettings -from nw.dialogs.quotes import GuiQuoteSelect -from nw.dialogs.updates import GuiUpdates -from nw.dialogs.wordlist import GuiWordList +from novelwriter.dialogs.about import GuiAbout +from novelwriter.dialogs.docmerge import GuiDocMerge +from novelwriter.dialogs.docsplit import GuiDocSplit +from novelwriter.dialogs.itemeditor import GuiItemEditor +from novelwriter.dialogs.preferences import GuiPreferences +from novelwriter.dialogs.projload import GuiProjectLoad +from novelwriter.dialogs.projsettings import GuiProjectSettings +from novelwriter.dialogs.quotes import GuiQuoteSelect +from novelwriter.dialogs.updates import GuiUpdates +from novelwriter.dialogs.wordlist import GuiWordList __all__ = [ "GuiAbout", diff --git a/nw/dialogs/about.py b/novelwriter/dialogs/about.py similarity index 96% rename from nw/dialogs/about.py rename to novelwriter/dialogs/about.py index d6f74ff5..498a25df 100644 --- a/nw/dialogs/about.py +++ b/novelwriter/dialogs/about.py @@ -23,9 +23,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import os import logging +import novelwriter from datetime import datetime @@ -47,7 +47,7 @@ class GuiAbout(QDialog): logger.debug("Initialising GuiAbout ...") self.setObjectName("GuiAbout") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme @@ -63,8 +63,8 @@ class GuiAbout(QDialog): self.nwIcon = QLabel() self.nwIcon.setPixmap(self.theParent.theTheme.getPixmap("novelwriter", (nPx, nPx))) self.lblName = QLabel("novelWriter") - self.lblVers = QLabel("v%s" % nw.__version__) - self.lblDate = QLabel(datetime.strptime(nw.__date__, "%Y-%m-%d").strftime("%x")) + self.lblVers = QLabel("v%s" % novelwriter.__version__) + self.lblDate = QLabel(datetime.strptime(novelwriter.__date__, "%Y-%m-%d").strftime("%x")) self.leftBox = QVBoxLayout() self.leftBox.setSpacing(self.mainConf.pxInt(4)) @@ -143,8 +143,10 @@ class GuiAbout(QDialog): "

{credits}

" ).format( title1=self.tr("About novelWriter"), - copy=nw.__copyright__, - link=self.tr("Website: {0}").format(f"{nw.__domain__}"), + copy=novelwriter.__copyright__, + link=self.tr("Website: {0}").format( + f"{novelwriter.__domain__}" + ), title2=self.tr("Credits"), credits=self._wrapTable([ (self.tr("Developer"), "Veronica Berglyd Olsen"), diff --git a/nw/dialogs/docmerge.py b/novelwriter/dialogs/docmerge.py similarity index 96% rename from nw/dialogs/docmerge.py rename to novelwriter/dialogs/docmerge.py index 2708bc68..e73e44fa 100644 --- a/nw/dialogs/docmerge.py +++ b/novelwriter/dialogs/docmerge.py @@ -23,8 +23,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( @@ -32,9 +32,9 @@ from PyQt5.QtWidgets import ( QListWidgetItem, QDialogButtonBox ) -from nw.core import NWDoc -from nw.enum import nwAlert, nwItemType -from nw.gui.custom import QHelpLabel +from novelwriter.core import NWDoc +from novelwriter.enum import nwAlert, nwItemType +from novelwriter.gui.custom import QHelpLabel logger = logging.getLogger(__name__) @@ -47,7 +47,7 @@ class GuiDocMerge(QDialog): logger.debug("Initialising GuiDocMerge ...") self.setObjectName("GuiDocMerge") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theProject = theParent.theProject self.sourceItem = None diff --git a/nw/dialogs/docsplit.py b/novelwriter/dialogs/docsplit.py similarity index 97% rename from nw/dialogs/docsplit.py rename to novelwriter/dialogs/docsplit.py index 5978fc7d..ed98fdd1 100644 --- a/nw/dialogs/docsplit.py +++ b/novelwriter/dialogs/docsplit.py @@ -23,8 +23,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( @@ -32,10 +32,10 @@ from PyQt5.QtWidgets import ( QListWidgetItem, QDialogButtonBox, QLabel ) -from nw.core import NWDoc -from nw.enum import nwAlert, nwItemType, nwItemClass, nwItemLayout -from nw.constants import nwConst -from nw.gui.custom import QHelpLabel +from novelwriter.core import NWDoc +from novelwriter.enum import nwAlert, nwItemType, nwItemClass, nwItemLayout +from novelwriter.constants import nwConst +from novelwriter.gui.custom import QHelpLabel logger = logging.getLogger(__name__) @@ -48,7 +48,7 @@ class GuiDocSplit(QDialog): logger.debug("Initialising GuiDocSplit ...") self.setObjectName("GuiDocSplit") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theProject = theParent.theProject self.optState = theParent.theProject.optState diff --git a/nw/dialogs/itemeditor.py b/novelwriter/dialogs/itemeditor.py similarity index 96% rename from nw/dialogs/itemeditor.py rename to novelwriter/dialogs/itemeditor.py index 0b4a514d..a49bcdca 100644 --- a/nw/dialogs/itemeditor.py +++ b/novelwriter/dialogs/itemeditor.py @@ -23,8 +23,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from PyQt5.QtCore import pyqtSlot from PyQt5.QtWidgets import ( @@ -32,9 +32,9 @@ from PyQt5.QtWidgets import ( QDialogButtonBox ) -from nw.enum import nwItemLayout, nwItemType -from nw.constants import trConst, nwLists, nwLabels -from nw.gui.custom import QSwitch +from novelwriter.enum import nwItemLayout, nwItemType +from novelwriter.constants import trConst, nwLists, nwLabels +from novelwriter.gui.custom import QSwitch logger = logging.getLogger(__name__) @@ -47,7 +47,7 @@ class GuiItemEditor(QDialog): logger.debug("Initialising GuiItemEditor ...") self.setObjectName("GuiItemEditor") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theProject = theParent.theProject diff --git a/nw/dialogs/preferences.py b/novelwriter/dialogs/preferences.py similarity index 98% rename from nw/dialogs/preferences.py rename to novelwriter/dialogs/preferences.py index 4029ed79..e14513fb 100644 --- a/nw/dialogs/preferences.py +++ b/novelwriter/dialogs/preferences.py @@ -23,9 +23,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import os import logging +import novelwriter from PyQt5.QtGui import QFont from PyQt5.QtCore import Qt, QLocale @@ -34,11 +34,11 @@ from PyQt5.QtWidgets import ( QLineEdit, QFileDialog, QFontDialog, QDoubleSpinBox ) -from nw.core import NWSpellSimple, NWSpellEnchant -from nw.enum import nwAlert -from nw.constants import nwConst -from nw.gui.custom import QSwitch, QConfigLayout, PagedDialog -from nw.dialogs.quotes import GuiQuoteSelect +from novelwriter.core import NWSpellSimple, NWSpellEnchant +from novelwriter.enum import nwAlert +from novelwriter.constants import nwConst +from novelwriter.gui.custom import QSwitch, QConfigLayout, PagedDialog +from novelwriter.dialogs.quotes import GuiQuoteSelect logger = logging.getLogger(__name__) @@ -51,7 +51,7 @@ class GuiPreferences(PagedDialog): logger.debug("Initialising GuiPreferences ...") self.setObjectName("GuiPreferences") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theProject = theParent.theProject @@ -143,7 +143,7 @@ class GuiPreferencesGeneral(QWidget): def __init__(self, theParent): QWidget.__init__(self, theParent) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme @@ -354,7 +354,7 @@ class GuiPreferencesProjects(QWidget): def __init__(self, theParent): QWidget.__init__(self, theParent) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme @@ -515,7 +515,7 @@ class GuiPreferencesDocuments(QWidget): def __init__(self, theParent): QWidget.__init__(self, theParent) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme @@ -686,7 +686,7 @@ class GuiPreferencesEditor(QWidget): def __init__(self, theParent): QWidget.__init__(self, theParent) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme @@ -887,7 +887,7 @@ class GuiPreferencesSyntax(QWidget): def __init__(self, theParent): QWidget.__init__(self, theParent) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme @@ -1012,7 +1012,7 @@ class GuiPreferencesAutomation(QWidget): def __init__(self, theParent): QWidget.__init__(self, theParent) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme @@ -1169,7 +1169,7 @@ class GuiPreferencesQuotes(QWidget): def __init__(self, theParent): QWidget.__init__(self, theParent) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme diff --git a/nw/dialogs/projload.py b/novelwriter/dialogs/projload.py similarity index 98% rename from nw/dialogs/projload.py rename to novelwriter/dialogs/projload.py index d7df41c6..939d5d90 100644 --- a/nw/dialogs/projload.py +++ b/novelwriter/dialogs/projload.py @@ -23,9 +23,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import os import logging +import novelwriter from datetime import datetime @@ -37,8 +37,8 @@ from PyQt5.QtWidgets import ( QFileDialog, QLineEdit ) -from nw.common import formatInt -from nw.constants import nwFiles +from novelwriter.common import formatInt +from novelwriter.constants import nwFiles logger = logging.getLogger(__name__) @@ -59,7 +59,7 @@ class GuiProjectLoad(QDialog): logger.debug("Initialising GuiProjectLoad ...") self.setObjectName("GuiProjectLoad") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme self.openState = self.NONE_STATE diff --git a/nw/dialogs/projsettings.py b/novelwriter/dialogs/projsettings.py similarity index 98% rename from nw/dialogs/projsettings.py rename to novelwriter/dialogs/projsettings.py index 5e3e8caa..e7311103 100644 --- a/nw/dialogs/projsettings.py +++ b/novelwriter/dialogs/projsettings.py @@ -23,8 +23,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from PyQt5.QtGui import QIcon, QPixmap, QColor, QBrush from PyQt5.QtCore import Qt, QLocale @@ -34,8 +34,8 @@ from PyQt5.QtWidgets import ( QComboBox ) -from nw.enum import nwAlert -from nw.gui.custom import QSwitch, PagedDialog, QConfigLayout +from novelwriter.enum import nwAlert +from novelwriter.gui.custom import QSwitch, PagedDialog, QConfigLayout logger = logging.getLogger(__name__) @@ -48,7 +48,7 @@ class GuiProjectSettings(PagedDialog): logger.debug("Initialising GuiProjectSettings ...") self.setObjectName("GuiProjectSettings") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theProject = theParent.theProject self.optState = theParent.theProject.optState @@ -162,7 +162,7 @@ class GuiProjectEditMain(QWidget): def __init__(self, theParent, theProject): QWidget.__init__(self, theParent) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theProject = theProject @@ -249,7 +249,7 @@ class GuiProjectEditStatus(QWidget): def __init__(self, theParent, theProject, isStatus): QWidget.__init__(self, theParent) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theProject = theProject self.optState = theProject.optState @@ -498,7 +498,7 @@ class GuiProjectEditReplace(QWidget): def __init__(self, theParent, theProject): QWidget.__init__(self, theParent) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme self.theProject = theProject diff --git a/nw/dialogs/quotes.py b/novelwriter/dialogs/quotes.py similarity index 97% rename from nw/dialogs/quotes.py rename to novelwriter/dialogs/quotes.py index 4f81ba29..ecc906ba 100644 --- a/nw/dialogs/quotes.py +++ b/novelwriter/dialogs/quotes.py @@ -23,8 +23,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from PyQt5.QtGui import QFontMetrics from PyQt5.QtCore import Qt, QSize @@ -33,7 +33,7 @@ from PyQt5.QtWidgets import ( QListWidget, QListWidgetItem, QFrame ) -from nw.constants import trConst, nwQuotes +from novelwriter.constants import trConst, nwQuotes logger = logging.getLogger(__name__) @@ -45,7 +45,7 @@ class GuiQuoteSelect(QDialog): def __init__(self, theParent=None, currentQuote='"'): QDialog.__init__(self, parent=theParent) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.outerBox = QVBoxLayout() self.innerBox = QHBoxLayout() diff --git a/nw/dialogs/updates.py b/novelwriter/dialogs/updates.py similarity index 94% rename from nw/dialogs/updates.py rename to novelwriter/dialogs/updates.py index d3a30632..64901452 100644 --- a/nw/dialogs/updates.py +++ b/novelwriter/dialogs/updates.py @@ -23,9 +23,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import json import logging +import novelwriter from datetime import datetime from urllib.request import Request, urlopen @@ -36,7 +36,7 @@ from PyQt5.QtWidgets import ( qApp, QDialog, QHBoxLayout, QVBoxLayout, QDialogButtonBox, QLabel ) -from nw.common import logException +from novelwriter.common import logException logger = logging.getLogger(__name__) @@ -49,7 +49,7 @@ class GuiUpdates(QDialog): logger.debug("Initialising GuiUpdates ...") self.setObjectName("GuiUpdates") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.setWindowTitle(self.tr("Check for Updates")) @@ -72,8 +72,8 @@ class GuiUpdates(QDialog): self.currentValue = QLabel(self.tr( "novelWriter {0} released on {1}" ).format( - "v%s" % nw.__version__, - datetime.strptime(nw.__date__, "%Y-%m-%d").strftime("%x")) + "v%s" % novelwriter.__version__, + datetime.strptime(novelwriter.__date__, "%Y-%m-%d").strftime("%x")) ) self.latestLabel = QLabel(self.tr("Latest Release")) @@ -152,7 +152,7 @@ class GuiUpdates(QDialog): self.latestLink.setText(self.tr( "Download: {0}" ).format( - f'{nw.__url__}' + f'{novelwriter.__url__}' )) qApp.restoreOverrideCursor() diff --git a/nw/dialogs/wordlist.py b/novelwriter/dialogs/wordlist.py similarity index 97% rename from nw/dialogs/wordlist.py rename to novelwriter/dialogs/wordlist.py index 4b05590c..50db4f12 100644 --- a/nw/dialogs/wordlist.py +++ b/novelwriter/dialogs/wordlist.py @@ -23,9 +23,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import os import logging +import novelwriter from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( @@ -33,8 +33,8 @@ from PyQt5.QtWidgets import ( QAbstractItemView, QPushButton, QLineEdit, QLabel ) -from nw.enum import nwAlert -from nw.constants import nwFiles +from novelwriter.enum import nwAlert +from novelwriter.constants import nwFiles logger = logging.getLogger(__name__) @@ -47,7 +47,7 @@ class GuiWordList(QDialog): logger.debug("Initialising GuiWordList ...") self.setObjectName("GuiWordList") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme self.theProject = theParent.theProject @@ -161,7 +161,7 @@ class GuiWordList(QDialog): except Exception: logger.error("Could not save new word list") - nw.logException() + novelwriter.logException() self.reject() return False diff --git a/nw/enum.py b/novelwriter/enum.py similarity index 100% rename from nw/enum.py rename to novelwriter/enum.py diff --git a/nw/error.py b/novelwriter/error.py similarity index 99% rename from nw/error.py rename to novelwriter/error.py index f75c1522..84b12ff7 100644 --- a/nw/error.py +++ b/novelwriter/error.py @@ -93,7 +93,7 @@ class NWErrorMessage(QDialog): error traceback. """ from traceback import format_tb - from nw import __issuesurl__, __version__ + from novelwriter import __issuesurl__, __version__ from PyQt5.Qt import PYQT_VERSION_STR from PyQt5.QtCore import QT_VERSION_STR, QSysInfo diff --git a/nw/gui/__init__.py b/novelwriter/gui/__init__.py similarity index 63% rename from nw/gui/__init__.py rename to novelwriter/gui/__init__.py index 9c7b3b83..6b233b9e 100644 --- a/nw/gui/__init__.py +++ b/novelwriter/gui/__init__.py @@ -19,17 +19,17 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -from nw.gui.doceditor import GuiDocEditor -from nw.gui.docviewer import GuiDocViewer, GuiDocViewDetails -from nw.gui.itemdetails import GuiItemDetails -from nw.gui.mainmenu import GuiMainMenu -from nw.gui.noveltree import GuiNovelTree -from nw.gui.outline import GuiOutline -from nw.gui.outlinedetails import GuiOutlineDetails -from nw.gui.projdetails import GuiProjectDetails -from nw.gui.projtree import GuiProjectTree -from nw.gui.statusbar import GuiMainStatus -from nw.gui.theme import GuiTheme +from novelwriter.gui.doceditor import GuiDocEditor +from novelwriter.gui.docviewer import GuiDocViewer, GuiDocViewDetails +from novelwriter.gui.itemdetails import GuiItemDetails +from novelwriter.gui.mainmenu import GuiMainMenu +from novelwriter.gui.noveltree import GuiNovelTree +from novelwriter.gui.outline import GuiOutline +from novelwriter.gui.outlinedetails import GuiOutlineDetails +from novelwriter.gui.projdetails import GuiProjectDetails +from novelwriter.gui.projtree import GuiProjectTree +from novelwriter.gui.statusbar import GuiMainStatus +from novelwriter.gui.theme import GuiTheme __all__ = [ "GuiDocEditor", diff --git a/nw/gui/custom.py b/novelwriter/gui/custom.py similarity index 97% rename from nw/gui/custom.py rename to novelwriter/gui/custom.py index eb04c5b7..d7e1605d 100644 --- a/nw/gui/custom.py +++ b/novelwriter/gui/custom.py @@ -25,8 +25,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from PyQt5.QtGui import QColor, QPalette, QPainter from PyQt5.QtCore import ( @@ -38,7 +38,7 @@ from PyQt5.QtWidgets import ( QStyleOptionTab, QLineEdit ) -from nw.constants import nwUnicode +from novelwriter.constants import nwUnicode logger = logging.getLogger(__name__) @@ -58,7 +58,7 @@ class QConfigLayout(QGridLayout): self._itemMap = {} - wSp = nw.CONFIG.pxInt(8) + wSp = novelwriter.CONFIG.pxInt(8) self.setHorizontalSpacing(wSp) self.setVerticalSpacing(wSp) self.setColumnStretch(0, 1) @@ -108,7 +108,7 @@ class QConfigLayout(QGridLayout): qLabel = None raise ValueError("theLabel must be a QLabel") - hM = nw.CONFIG.pxInt(4) + hM = novelwriter.CONFIG.pxInt(4) qLabel.setContentsMargins(0, hM, 0, hM) self.addWidget(qLabel, self._nextRow, 0, 1, 2, Qt.AlignLeft) @@ -142,7 +142,7 @@ class QConfigLayout(QGridLayout): qWidget = None raise ValueError("theWidget must be a QWidget") - wSp = nw.CONFIG.pxInt(8) + wSp = novelwriter.CONFIG.pxInt(8) qLabel.setIndent(wSp) if helpText is not None: qHelp = QHelpLabel(str(helpText), self._helpCol, self._fontScale) @@ -235,18 +235,18 @@ class QSwitch(QAbstractButton): super().__init__(parent=parent) if width is None: - self._xW = nw.CONFIG.pxInt(40) + self._xW = novelwriter.CONFIG.pxInt(40) else: self._xW = width if height is None: - self._xH = nw.CONFIG.pxInt(20) + self._xH = novelwriter.CONFIG.pxInt(20) else: self._xH = height self._xR = int(self._xH*0.5) self._xT = int(self._xH*0.6) - self._rB = int(nw.CONFIG.guiScale*2) + self._rB = int(novelwriter.CONFIG.guiScale*2) self._rH = self._xH - 2*self._rB self._rR = self._xR - self._rB @@ -428,7 +428,7 @@ class VerticalTabBar(QTabBar): def __init__(self, theParent=None): QTabBar.__init__(self, parent=theParent) - self._mW = nw.CONFIG.pxInt(150) + self._mW = novelwriter.CONFIG.pxInt(150) return def tabSizeHint(self, theIndex): diff --git a/nw/gui/doceditor.py b/novelwriter/gui/doceditor.py similarity index 99% rename from nw/gui/doceditor.py rename to novelwriter/gui/doceditor.py index 4661cec2..9a0c260e 100644 --- a/nw/gui/doceditor.py +++ b/novelwriter/gui/doceditor.py @@ -29,8 +29,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from time import time @@ -48,11 +48,11 @@ from PyQt5.QtWidgets import ( QFrame ) -from nw.core import NWDoc, NWSpellSimple, countWords -from nw.enum import nwAlert, nwDocAction, nwDocInsert, nwItemClass -from nw.common import transferCase -from nw.constants import nwConst, nwKeyWords, nwUnicode -from nw.gui.dochighlight import GuiDocHighlighter +from novelwriter.core import NWDoc, NWSpellSimple, countWords +from novelwriter.enum import nwAlert, nwDocAction, nwDocInsert, nwItemClass +from novelwriter.common import transferCase +from novelwriter.constants import nwConst, nwKeyWords, nwUnicode +from novelwriter.gui.dochighlight import GuiDocHighlighter logger = logging.getLogger(__name__) @@ -75,7 +75,7 @@ class GuiDocEditor(QTextEdit): logger.debug("Initialising GuiDocEditor ...") # Class Variables - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme self.theIndex = theParent.theIndex @@ -1973,7 +1973,7 @@ class GuiDocEditor(QTextEdit): setting in config. """ if self.mainConf.spellTool == nwConst.SP_ENCHANT: - from nw.core.spellcheck import NWSpellEnchant + from novelwriter.core.spellcheck import NWSpellEnchant self._theDict = NWSpellEnchant() else: self._theDict = NWSpellSimple() @@ -2047,7 +2047,7 @@ class GuiDocEditSearch(QFrame): logger.debug("Initialising GuiDocEditSearch ...") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.docEditor = docEditor self.theParent = docEditor.theParent self.theProject = docEditor.theProject @@ -2423,7 +2423,7 @@ class GuiDocEditHeader(QWidget): logger.debug("Initialising GuiDocEditHeader ...") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.docEditor = docEditor self.theParent = docEditor.theParent self.theProject = docEditor.theProject @@ -2647,7 +2647,7 @@ class GuiDocEditFooter(QWidget): logger.debug("Initialising GuiDocEditFooter ...") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.docEditor = docEditor self.theParent = docEditor.theParent self.theProject = docEditor.theProject diff --git a/nw/gui/dochighlight.py b/novelwriter/gui/dochighlight.py similarity index 99% rename from nw/gui/dochighlight.py rename to novelwriter/gui/dochighlight.py index 94fd6837..5d39b914 100644 --- a/nw/gui/dochighlight.py +++ b/novelwriter/gui/dochighlight.py @@ -23,8 +23,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from time import time @@ -33,8 +33,8 @@ from PyQt5.QtGui import ( QColor, QTextCharFormat, QFont, QSyntaxHighlighter, QBrush ) -from nw.constants import nwRegEx, nwUnicode -from nw.common import checkInt +from novelwriter.constants import nwRegEx, nwUnicode +from novelwriter.common import checkInt logger = logging.getLogger(__name__) @@ -50,7 +50,7 @@ class GuiDocHighlighter(QSyntaxHighlighter): QSyntaxHighlighter.__init__(self, theDoc) logger.debug("Initialising GuiDocHighlighter ...") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theDoc = theDoc self.theParent = theParent self.theTheme = theParent.theTheme diff --git a/nw/gui/docviewer.py b/novelwriter/gui/docviewer.py similarity index 99% rename from nw/gui/docviewer.py rename to novelwriter/gui/docviewer.py index e45d7627..823ee845 100644 --- a/nw/gui/docviewer.py +++ b/novelwriter/gui/docviewer.py @@ -27,8 +27,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from PyQt5.QtCore import Qt, QUrl, QSize, pyqtSlot from PyQt5.QtGui import ( @@ -39,9 +39,9 @@ from PyQt5.QtWidgets import ( QAction, QMenu ) -from nw.core import ToHtml -from nw.enum import nwAlert, nwItemType, nwDocAction -from nw.constants import nwUnicode +from novelwriter.core import ToHtml +from novelwriter.enum import nwAlert, nwItemType, nwDocAction +from novelwriter.constants import nwUnicode logger = logging.getLogger(__name__) @@ -54,7 +54,7 @@ class GuiDocViewer(QTextBrowser): logger.debug("Initialising GuiDocViewer ...") # Class Variables - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme self.theProject = theParent.theProject @@ -185,7 +185,7 @@ class GuiDocViewer(QTextBrowser): aDoc.doPostProcessing() except Exception: logger.error("Failed to generate preview for document with handle '%s'", tHandle) - nw.logException() + novelwriter.logException() self.setText(self.tr("An error occurred while generating the preview.")) return False @@ -719,7 +719,7 @@ class GuiDocViewHeader(QWidget): logger.debug("Initialising GuiDocViewHeader ...") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.docViewer = docViewer self.theParent = docViewer.theParent self.theProject = docViewer.theProject @@ -926,7 +926,7 @@ class GuiDocViewFooter(QWidget): logger.debug("Initialising GuiDocViewFooter ...") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.docViewer = docViewer self.theParent = docViewer.theParent self.theTheme = docViewer.theTheme @@ -1151,7 +1151,7 @@ class GuiDocViewDetails(QScrollArea): QScrollArea.__init__(self, theParent) logger.debug("Initialising GuiDocViewDetails ...") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theProject = theParent.theProject self.theTheme = theParent.theTheme diff --git a/nw/gui/itemdetails.py b/novelwriter/gui/itemdetails.py similarity index 98% rename from nw/gui/itemdetails.py rename to novelwriter/gui/itemdetails.py index 72f9d183..60906a8d 100644 --- a/nw/gui/itemdetails.py +++ b/novelwriter/gui/itemdetails.py @@ -23,15 +23,15 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from PyQt5.QtCore import Qt, pyqtSlot from PyQt5.QtGui import QFont, QPixmap from PyQt5.QtWidgets import QWidget, QGridLayout, QLabel -from nw.enum import nwItemClass, nwItemType -from nw.constants import trConst, nwLabels +from novelwriter.enum import nwItemClass, nwItemType +from novelwriter.constants import trConst, nwLabels logger = logging.getLogger(__name__) @@ -42,7 +42,7 @@ class GuiItemDetails(QWidget): QWidget.__init__(self, theParent) logger.debug("Initialising GuiItemDetails ...") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theProject = theParent.theProject self.theTheme = theParent.theTheme diff --git a/nw/gui/mainmenu.py b/novelwriter/gui/mainmenu.py similarity index 98% rename from nw/gui/mainmenu.py rename to novelwriter/gui/mainmenu.py index 344f2573..dee5568e 100644 --- a/nw/gui/mainmenu.py +++ b/novelwriter/gui/mainmenu.py @@ -23,8 +23,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from urllib.parse import urljoin from urllib.request import pathname2url @@ -33,8 +33,8 @@ from PyQt5.QtCore import QUrl from PyQt5.QtGui import QDesktopServices from PyQt5.QtWidgets import QMenuBar, QAction -from nw.enum import nwItemType, nwItemClass, nwDocAction, nwDocInsert, nwWidget -from nw.constants import trConst, nwKeyWords, nwLabels, nwUnicode +from novelwriter.enum import nwItemType, nwItemClass, nwDocAction, nwDocInsert, nwWidget +from novelwriter.constants import trConst, nwKeyWords, nwLabels, nwUnicode logger = logging.getLogger(__name__) @@ -45,7 +45,7 @@ class GuiMainMenu(QMenuBar): QMenuBar.__init__(self, theParent) logger.debug("Initialising GuiMainMenu ...") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theProject = theParent.theProject @@ -1087,10 +1087,10 @@ class GuiMainMenu(QMenuBar): self.helpMenu.addSeparator() # Help > User Manual (Online) - if nw.__version__[-2] == "f": - docUrl = f"{nw.__docurl__}/en/stable/" + if novelwriter.__version__[-2] == "f": + docUrl = f"{novelwriter.__docurl__}/en/stable/" else: - docUrl = f"{nw.__docurl__}/en/latest/" + docUrl = f"{novelwriter.__docurl__}/en/latest/" self.aHelpDocs = QAction(self.tr("User Manual (Online)"), self) self.aHelpDocs.setStatusTip(self.tr("Open documentation in browser")) @@ -1112,25 +1112,25 @@ class GuiMainMenu(QMenuBar): # Document > Report an Issue self.aIssue = QAction(self.tr("Report an Issue (GitHub)"), self) self.aIssue.setStatusTip( - self.tr("Report a bug or issue on GitHub at {0}").format(nw.__issuesurl__) + self.tr("Report a bug or issue on GitHub at {0}").format(novelwriter.__issuesurl__) ) - self.aIssue.triggered.connect(lambda: self._openWebsite(nw.__issuesurl__)) + self.aIssue.triggered.connect(lambda: self._openWebsite(novelwriter.__issuesurl__)) self.helpMenu.addAction(self.aIssue) # Document > Ask a Question self.aQuestion = QAction(self.tr("Ask a Question (GitHub)"), self) self.aQuestion.setStatusTip( - self.tr("Ask a question on GitHub at {0}").format(nw.__helpurl__) + self.tr("Ask a question on GitHub at {0}").format(novelwriter.__helpurl__) ) - self.aQuestion.triggered.connect(lambda: self._openWebsite(nw.__helpurl__)) + self.aQuestion.triggered.connect(lambda: self._openWebsite(novelwriter.__helpurl__)) self.helpMenu.addAction(self.aQuestion) # Document > Main Website self.aWebsite = QAction(self.tr("The novelWriter Website"), self) self.aWebsite.setStatusTip( - self.tr("Open the novelWriter website at {0}").format(nw.__url__) + self.tr("Open the novelWriter website at {0}").format(novelwriter.__url__) ) - self.aWebsite.triggered.connect(lambda: self._openWebsite(nw.__url__)) + self.aWebsite.triggered.connect(lambda: self._openWebsite(novelwriter.__url__)) self.helpMenu.addAction(self.aWebsite) # Help > Separator diff --git a/nw/gui/noveltree.py b/novelwriter/gui/noveltree.py similarity index 98% rename from nw/gui/noveltree.py rename to novelwriter/gui/noveltree.py index 6d99d07e..3ab9d7c2 100644 --- a/nw/gui/noveltree.py +++ b/novelwriter/gui/noveltree.py @@ -23,16 +23,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from time import time from PyQt5.QtCore import Qt, QSize from PyQt5.QtWidgets import QTreeWidget, QTreeWidgetItem, QAbstractItemView -from nw.common import checkInt -from nw.constants import nwKeyWords +from novelwriter.common import checkInt +from novelwriter.constants import nwKeyWords logger = logging.getLogger(__name__) @@ -48,7 +48,7 @@ class GuiNovelTree(QTreeWidget): logger.debug("Initialising GuiNovelTree ...") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme self.theProject = theParent.theProject diff --git a/nw/gui/outline.py b/novelwriter/gui/outline.py similarity index 98% rename from nw/gui/outline.py rename to novelwriter/gui/outline.py index eeea2b7a..251ad63a 100644 --- a/nw/gui/outline.py +++ b/novelwriter/gui/outline.py @@ -23,8 +23,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from time import time @@ -33,8 +33,8 @@ from PyQt5.QtWidgets import ( QTreeWidget, QTreeWidgetItem, QMenu, QAction, QAbstractItemView ) -from nw.enum import nwItemLayout, nwItemType, nwOutline -from nw.constants import trConst, nwKeyWords, nwLabels +from novelwriter.enum import nwItemLayout, nwItemType, nwOutline +from novelwriter.constants import trConst, nwKeyWords, nwLabels logger = logging.getLogger(__name__) @@ -86,7 +86,7 @@ class GuiOutline(QTreeWidget): logger.debug("Initialising GuiOutline ...") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theProject = theParent.theProject self.theTheme = theParent.theTheme diff --git a/nw/gui/outlinedetails.py b/novelwriter/gui/outlinedetails.py similarity index 98% rename from nw/gui/outlinedetails.py rename to novelwriter/gui/outlinedetails.py index 87b9aba6..90dad74d 100644 --- a/nw/gui/outlinedetails.py +++ b/novelwriter/gui/outlinedetails.py @@ -23,16 +23,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from PyQt5.QtCore import Qt, QT_TRANSLATE_NOOP from PyQt5.QtWidgets import ( QScrollArea, QWidget, QGridLayout, QHBoxLayout, QGroupBox, QLabel ) -from nw.common import checkInt -from nw.constants import trConst, nwKeyWords, nwLabels +from novelwriter.common import checkInt +from novelwriter.constants import trConst, nwKeyWords, nwLabels logger = logging.getLogger(__name__) @@ -51,7 +51,7 @@ class GuiOutlineDetails(QScrollArea): logger.debug("Initialising GuiOutlineDetails ...") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theProject = theParent.theProject self.theTheme = theParent.theTheme diff --git a/nw/gui/projdetails.py b/novelwriter/gui/projdetails.py similarity index 98% rename from nw/gui/projdetails.py rename to novelwriter/gui/projdetails.py index 7ba5bc5a..a1a769a5 100644 --- a/nw/gui/projdetails.py +++ b/novelwriter/gui/projdetails.py @@ -23,9 +23,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import math import logging +import novelwriter from PyQt5.QtCore import Qt, QSize from PyQt5.QtGui import QFont @@ -34,9 +34,9 @@ from PyQt5.QtWidgets import ( QLabel, QSpinBox, QGridLayout, QHBoxLayout, QLineEdit, QAbstractItemView ) -from nw.common import numberToRoman -from nw.constants import nwUnicode -from nw.gui.custom import PagedDialog, QSwitch +from novelwriter.common import numberToRoman +from novelwriter.constants import nwUnicode +from novelwriter.gui.custom import PagedDialog, QSwitch logger = logging.getLogger(__name__) @@ -49,7 +49,7 @@ class GuiProjectDetails(PagedDialog): logger.debug("Initialising GuiProjectDetails ...") self.setObjectName("GuiProjectDetails") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theProject = theParent.theProject self.optState = theParent.theProject.optState @@ -134,7 +134,7 @@ class GuiProjectDetailsMain(QWidget): def __init__(self, theParent, theProject): QWidget.__init__(self, theParent) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theProject = theProject self.theTheme = theParent.theTheme @@ -254,7 +254,7 @@ class GuiProjectDetailsContents(QWidget): def __init__(self, theParent, theProject): QWidget.__init__(self, theParent) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theProject = theProject self.theTheme = theParent.theTheme diff --git a/nw/gui/projtree.py b/novelwriter/gui/projtree.py similarity index 99% rename from nw/gui/projtree.py rename to novelwriter/gui/projtree.py index 09969241..18217039 100644 --- a/nw/gui/projtree.py +++ b/novelwriter/gui/projtree.py @@ -24,8 +24,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from time import time @@ -35,9 +35,9 @@ from PyQt5.QtWidgets import ( QTreeWidget, QTreeWidgetItem, QAbstractItemView, QMenu, QAction ) -from nw.core import NWDoc -from nw.enum import nwItemType, nwItemClass, nwItemLayout, nwAlert -from nw.constants import nwConst, trConst, nwLists, nwLabels +from novelwriter.core import NWDoc +from novelwriter.enum import nwItemType, nwItemClass, nwItemLayout, nwAlert +from novelwriter.constants import nwConst, trConst, nwLists, nwLabels logger = logging.getLogger(__name__) @@ -58,7 +58,7 @@ class GuiProjectTree(QTreeWidget): logger.debug("Initialising GuiProjectTree ...") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme self.theProject = theParent.theProject diff --git a/nw/gui/statusbar.py b/novelwriter/gui/statusbar.py similarity index 98% rename from nw/gui/statusbar.py rename to novelwriter/gui/statusbar.py index 5b369e36..db92b388 100644 --- a/nw/gui/statusbar.py +++ b/novelwriter/gui/statusbar.py @@ -23,8 +23,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import logging +import novelwriter from time import time @@ -32,8 +32,8 @@ from PyQt5.QtCore import QLocale, pyqtSlot from PyQt5.QtGui import QColor, QPainter from PyQt5.QtWidgets import qApp, QStatusBar, QLabel, QAbstractButton -from nw.common import formatTime -from nw.enum import nwState +from novelwriter.common import formatTime +from novelwriter.enum import nwState logger = logging.getLogger(__name__) @@ -45,7 +45,7 @@ class GuiMainStatus(QStatusBar): logger.debug("Initialising GuiMainStatus ...") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme self.refTime = None diff --git a/nw/gui/theme.py b/novelwriter/gui/theme.py similarity index 98% rename from nw/gui/theme.py rename to novelwriter/gui/theme.py index 5932d171..f643f0c8 100644 --- a/nw/gui/theme.py +++ b/novelwriter/gui/theme.py @@ -24,9 +24,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import os import logging +import novelwriter from math import ceil from functools import partial @@ -37,9 +37,9 @@ from PyQt5.QtGui import ( QPalette, QColor, QIcon, QFont, QFontMetrics, QFontDatabase, QPixmap ) -from nw.enum import nwAlert, nwItemLayout, nwItemType -from nw.common import NWConfigParser -from nw.constants import nwLabels +from novelwriter.enum import nwAlert, nwItemLayout, nwItemType +from novelwriter.common import NWConfigParser +from novelwriter.constants import nwLabels logger = logging.getLogger(__name__) @@ -53,7 +53,7 @@ class GuiTheme: def __init__(self, theParent): - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theIcons = GuiIcons(self.theParent) self.guiPalette = QPalette() @@ -279,7 +279,7 @@ class GuiTheme: cssData = inFile.read() except Exception: logger.error("Could not load theme css file") - nw.logException() + novelwriter.logException() return False # Config File @@ -289,7 +289,7 @@ class GuiTheme: confParser.read_file(inFile) except Exception: logger.error("Could not load theme settings from: %s", self.confFile) - nw.logException() + novelwriter.logException() return False # Main @@ -347,7 +347,7 @@ class GuiTheme: confParser.read_file(inFile) except Exception: logger.error("Could not load syntax colours from: %s", self.syntaxFile) - nw.logException() + novelwriter.logException() return False # Main @@ -596,7 +596,7 @@ class GuiIcons: def __init__(self, theParent): - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent # Storage @@ -648,7 +648,7 @@ class GuiIcons: confParser.read_file(inFile) except Exception: logger.error("Could not load icon theme settings from: %s", self.confFile) - nw.logException() + novelwriter.logException() return False # Main diff --git a/nw/guimain.py b/novelwriter/guimain.py similarity index 98% rename from nw/guimain.py rename to novelwriter/guimain.py index bcb8cb1b..bcbe645b 100644 --- a/nw/guimain.py +++ b/novelwriter/guimain.py @@ -23,9 +23,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import os import logging +import novelwriter from time import time from datetime import datetime @@ -37,20 +37,22 @@ from PyQt5.QtWidgets import ( QMessageBox, QDialog, QTabWidget, QToolBar, QAction ) -from nw.gui import ( +from novelwriter.gui import ( GuiDocEditor, GuiDocViewDetails, GuiDocViewer, GuiItemDetails, GuiMainMenu, GuiMainStatus, GuiNovelTree, GuiOutline, GuiOutlineDetails, GuiProjectDetails, GuiProjectTree, GuiTheme ) -from nw.dialogs import ( +from novelwriter.dialogs import ( GuiAbout, GuiDocMerge, GuiDocSplit, GuiItemEditor, GuiPreferences, GuiProjectLoad, GuiProjectSettings, GuiUpdates, GuiWordList ) -from nw.tools import GuiBuildNovel, GuiProjectWizard, GuiWritingStats -from nw.core import NWProject, NWIndex -from nw.enum import nwItemType, nwItemClass, nwAlert, nwWidget, nwState -from nw.common import getGuiItem, hexToInt -from nw.constants import nwLists +from novelwriter.tools import GuiBuildNovel, GuiProjectWizard, GuiWritingStats +from novelwriter.core import NWProject, NWIndex +from novelwriter.enum import ( + nwItemType, nwItemClass, nwAlert, nwWidget, nwState +) +from novelwriter.common import getGuiItem, hexToInt +from novelwriter.constants import nwLists logger = logging.getLogger(__name__) @@ -62,7 +64,7 @@ class GuiMain(QMainWindow): logger.debug("Initialising GUI ...") self.setObjectName("GuiMain") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.threadPool = QThreadPool() # System Info @@ -289,7 +291,7 @@ class GuiMain(QMainWindow): logger.debug("GUI initialisation complete") - if nw.__hexversion__[-2] == "a" and logger.getEffectiveLevel() > logging.DEBUG: + if novelwriter.__hexversion__[-2] == "a" and logger.getEffectiveLevel() > logging.DEBUG: self.makeAlert(self.tr( "You are running an untested development version of novelWriter. " "Please be careful when working on a live project " @@ -337,8 +339,8 @@ class GuiMain(QMainWindow): """Determine whether release notes need to be shown, and show them by calling the About dialog. """ - if hexToInt(self.mainConf.lastNotes) < hexToInt(nw.__hexversion__): - self.mainConf.lastNotes = nw.__hexversion__ + if hexToInt(self.mainConf.lastNotes) < hexToInt(novelwriter.__hexversion__): + self.mainConf.lastNotes = novelwriter.__hexversion__ self.showAboutNWDialog(showNotes=True) return diff --git a/nw/tools/__init__.py b/novelwriter/tools/__init__.py similarity index 83% rename from nw/tools/__init__.py rename to novelwriter/tools/__init__.py index 0319d6b9..2d4b59c1 100644 --- a/nw/tools/__init__.py +++ b/novelwriter/tools/__init__.py @@ -19,9 +19,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -from nw.tools.build import GuiBuildNovel -from nw.tools.projwizard import GuiProjectWizard -from nw.tools.writingstats import GuiWritingStats +from novelwriter.tools.build import GuiBuildNovel +from novelwriter.tools.projwizard import GuiProjectWizard +from novelwriter.tools.writingstats import GuiWritingStats __all__ = [ "GuiBuildNovel", diff --git a/nw/tools/build.py b/novelwriter/tools/build.py similarity index 98% rename from nw/tools/build.py rename to novelwriter/tools/build.py index 990bb9ec..dca2fc27 100644 --- a/nw/tools/build.py +++ b/novelwriter/tools/build.py @@ -23,10 +23,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import os import json import logging +import novelwriter from time import time from datetime import datetime @@ -43,11 +43,11 @@ from PyQt5.QtWidgets import ( ) from PyQt5.QtPrintSupport import QPrinter, QPrintPreviewDialog -from nw.core import ToHtml, ToOdt, ToMarkdown -from nw.enum import nwAlert, nwItemType, nwItemLayout, nwItemClass -from nw.common import fuzzyTime, makeFileNameSafe -from nw.constants import nwConst, nwFiles -from nw.gui.custom import QSwitch +from novelwriter.core import ToHtml, ToOdt, ToMarkdown +from novelwriter.enum import nwAlert, nwItemType, nwItemLayout, nwItemClass +from novelwriter.common import fuzzyTime, makeFileNameSafe +from novelwriter.constants import nwConst, nwFiles +from novelwriter.gui.custom import QSwitch logger = logging.getLogger(__name__) @@ -70,7 +70,7 @@ class GuiBuildNovel(QDialog): logger.debug("Initialising GuiBuildNovel ...") self.setObjectName("GuiBuildNovel") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme self.theProject = theParent.theProject @@ -727,7 +727,7 @@ class GuiBuildNovel(QDialog): except Exception: logger.error("Failed to build document '%s'", tItem.itemHandle) - nw.logException() + novelwriter.logException() if isPreview: self.docView.setText(( "Failed to generate preview. " @@ -1050,7 +1050,7 @@ class GuiBuildNovel(QDialog): theData = json.loads(theJson) except Exception: logger.error("Failed to load build cache") - nw.logException() + novelwriter.logException() return False if "buildTime" in theData.keys(): @@ -1078,7 +1078,7 @@ class GuiBuildNovel(QDialog): }, indent=2)) except Exception: logger.error("Failed to save build cache") - nw.logException() + novelwriter.logException() return False return True @@ -1186,7 +1186,7 @@ class GuiBuildNovelDocView(QTextBrowser): logger.debug("Initialising GuiBuildNovelDocView ...") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theProject = theProject self.theParent = theParent self.theTheme = theParent.theTheme diff --git a/nw/tools/projwizard.py b/novelwriter/tools/projwizard.py similarity index 96% rename from nw/tools/projwizard.py rename to novelwriter/tools/projwizard.py index 80082009..64f0f645 100644 --- a/nw/tools/projwizard.py +++ b/novelwriter/tools/projwizard.py @@ -23,9 +23,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import os import logging +import novelwriter from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( @@ -34,10 +34,10 @@ from PyQt5.QtWidgets import ( QGroupBox, QGridLayout, QSpinBox ) -from nw.enum import nwItemClass -from nw.common import makeFileNameSafe -from nw.constants import trConst, nwLabels -from nw.gui.custom import QSwitch +from novelwriter.enum import nwItemClass +from novelwriter.common import makeFileNameSafe +from novelwriter.constants import trConst, nwLabels +from novelwriter.gui.custom import QSwitch logger = logging.getLogger(__name__) @@ -56,7 +56,7 @@ class GuiProjectWizard(QWizard): logger.debug("Initialising GuiProjectWizard ...") self.setObjectName("GuiProjectWizard") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme @@ -92,7 +92,7 @@ class ProjWizardIntroPage(QWizardPage): def __init__(self, theWizard): QWizardPage.__init__(self) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theWizard = theWizard self.theTheme = theWizard.theTheme @@ -162,7 +162,7 @@ class ProjWizardFolderPage(QWizardPage): def __init__(self, theWizard): QWizardPage.__init__(self) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theWizard = theWizard self.theTheme = theWizard.theTheme @@ -235,7 +235,7 @@ class ProjWizardPopulatePage(QWizardPage): def __init__(self, theWizard): QWizardPage.__init__(self) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theWizard = theWizard self.setTitle(self.tr("Populate Project")) @@ -291,7 +291,7 @@ class ProjWizardCustomPage(QWizardPage): def __init__(self, theWizard): QWizardPage.__init__(self) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theWizard = theWizard self.setTitle(self.tr("Custom Project Options")) @@ -410,7 +410,7 @@ class ProjWizardFinalPage(QWizardPage): def __init__(self, theWizard): QWizardPage.__init__(self) - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theWizard = theWizard self.setTitle(self.tr("Finished")) diff --git a/nw/tools/writingstats.py b/novelwriter/tools/writingstats.py similarity index 98% rename from nw/tools/writingstats.py rename to novelwriter/tools/writingstats.py index 79228074..eab9c05b 100644 --- a/nw/tools/writingstats.py +++ b/novelwriter/tools/writingstats.py @@ -23,10 +23,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import os import json import logging +import novelwriter from datetime import datetime @@ -37,10 +37,10 @@ from PyQt5.QtWidgets import ( QLabel, QGroupBox, QMenu, QAction, QFileDialog, QSpinBox, QHBoxLayout ) -from nw.enum import nwAlert -from nw.common import formatTime, checkInt -from nw.constants import nwConst, nwFiles -from nw.gui.custom import QSwitch +from novelwriter.enum import nwAlert +from novelwriter.common import formatTime, checkInt +from novelwriter.constants import nwConst, nwFiles +from novelwriter.gui.custom import QSwitch logger = logging.getLogger(__name__) @@ -62,7 +62,7 @@ class GuiWritingStats(QDialog): logger.debug("Initialising GuiWritingStats ...") self.setObjectName("GuiWritingStats") - self.mainConf = nw.CONFIG + self.mainConf = novelwriter.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme self.theProject = theParent.theProject diff --git a/sample/nwProject.nwx b/sample/nwProject.nwx index 068e7e4a..0e9c0a1b 100644 --- a/sample/nwProject.nwx +++ b/sample/nwProject.nwx @@ -1,13 +1,13 @@ - + Sample Project Sample Project Jane Smith Jay Doh - 1249 + 1251 198 - 61069 + 61076 False diff --git a/setup.cfg b/setup.cfg index 9cd2d28b..244a59fb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = novelWriter -version = attr: nw.__version__ +version = attr: novelwriter.__version__ author = Veronica Berglyd Olsen author_email = code@vkbo.net description = A markdown-like document editor for writing novels @@ -41,9 +41,9 @@ exclude = docs, tests, sample [options.entry_points] console_script = - novelWriter-cli = nw:main + novelWriter-cli = novelwriter:main gui_scripts = - novelWriter = nw:main + novelWriter = novelwriter:main [bdist_wheel] universal = 0 diff --git a/setup.py b/setup.py index a2345f61..1f03d07e 100755 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ def extractVersion(): numVers = "Unknown" hexVers = "Unknown" - initFile = os.path.join("nw", "__init__.py") + initFile = os.path.join("novelwriter", "__init__.py") try: with open(initFile, mode="r", encoding="utf-8") as inFile: for aLine in inFile: @@ -67,6 +67,14 @@ def extractVersion(): return numVers, hexVers +def sysCall(callArgs): + """Wrapper function for system calls. + """ + sysP = subprocess.Popen(callArgs, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) + stdOut, stdErr = sysP.communicate() + return stdOut.decode("utf-8"), stdErr.decode("utf-8"), sysP.returncode + + # =============================================================================================== # # General # =============================================================================================== # @@ -153,11 +161,11 @@ def cleanInstall(): def buildQtDocs(): """This function will build the documentation as a Qt help file. The - file is then copied into the nw/assets/help directory and can be - included in builds. + file is then copied into the novelwriter/assets/help directory and + can be included in builds. """ buildDir = os.path.join("docs", "build", "qthelp") - helpDir = os.path.join("nw", "assets", "help") + helpDir = os.path.join("novelwriter", "assets", "help") inFile = "novelWriter.qhcp" outFile = "novelWriter.qhc" @@ -227,7 +235,7 @@ def buildQtDocs(): def buildLocalDocs(bldFmt="HTML"): """This function will build the Sphinx HTML or PDF documentation. - For HTML, the files are then copied into the nw/assets/help/html + For HTML, the files are copied into the novelwriter/assets/help/html directory and can be included in builds. """ print("") @@ -250,22 +258,31 @@ def buildLocalDocs(bldFmt="HTML"): if bldFmt == "HTML": subprocess.call(["make", "-C", "docs", "html"]) elif bldFmt == "PDF": - subprocess.call(["make", "-C", "docs", "latexpdf"]) + _, stdErr, exCode = sysCall(["make -C docs latexpdf"]) + if exCode == 0: + print("Sphinx LaTeX PDF build OK") + else: + raise Exception(stdErr) + except Exception as e: print("Docs Build Error:") print(str(e)) buildFail = True try: + helpDir = os.path.join("novelwriter", "assets", "help") + if not os.path.isdir(helpDir): + os.mkdir(helpDir) + if bldFmt == "HTML": - helpDir = os.path.join("nw", "assets", "help", "html") - if os.path.isdir(helpDir): - shutil.rmtree(helpDir) - shutil.copytree(buildDir, helpDir) + htmlDir = os.path.join(helpDir, "html") + if os.path.isdir(htmlDir): + shutil.rmtree(htmlDir) + shutil.copytree(buildDir, htmlDir) elif bldFmt == "PDF": os.rename( os.path.join(buildDir, "manual.pdf"), - os.path.join("nw", "assets", "help", "manual.pdf") + os.path.join(helpDir, "manual.pdf") ) except Exception as e: print("Docs Build Error:") @@ -314,7 +331,7 @@ def buildQtI18n(): print("Moving QM Files to Assets") print("") - langDir = os.path.join("nw", "assets", "i18n") + langDir = os.path.join("novelwriter", "assets", "i18n") for langFile in os.listdir("i18n"): langPath = os.path.join("i18n", langFile) if not os.path.isfile(langPath): @@ -360,7 +377,7 @@ def buildQtI18nTS(): def buildSampleZip(): """Bundle the sample project into a single zip file to be saved into - the nw/assets folder for further bundling into builds. + the novelwriter/assets folder for further bundling into builds. """ print("") print("Building Sample ZIP File") @@ -368,7 +385,7 @@ def buildSampleZip(): print("") srcSample = "sample" - dstSample = os.path.join("nw", "assets", "sample.zip") + dstSample = os.path.join("novelwriter", "assets", "sample.zip") if os.path.isdir(srcSample): if os.path.isfile(dstSample): @@ -461,7 +478,7 @@ def makeMinimalPackage(targetOS): os.unlink(outFile) # Add the manual also to the root - pdfDocs = os.path.join("nw", "assets", "help", "manual.pdf") + pdfDocs = os.path.join("novelwriter", "assets", "help", "manual.pdf") if os.path.isfile(pdfDocs): os.rename(pdfDocs, "UserManual.pdf") @@ -477,13 +494,13 @@ def makeMinimalPackage(targetOS): with ZipFile(outFile, "w", compression=ZIP_DEFLATED, compresslevel=9) as zipObj: if targetOS != OS_WIN: - # Not needed for Windows as the icons are in nw/assets/icons + # Not needed for Windows as the icons are in novelwriter/assets/icons for nRoot, _, nFiles in os.walk("setup"): print("Adding Folder: %s [%d files]" % (nRoot, len(nFiles))) for aFile in nFiles: zipObj.write(os.path.join(nRoot, aFile)) - for nRoot, _, nFiles in os.walk("nw"): + for nRoot, _, nFiles in os.walk("novelwriter"): if nRoot.endswith("__pycache__"): print("Skipping Folder: %s" % nRoot) continue @@ -602,8 +619,8 @@ def makeSimplePackage(embedPython): iconList = ["novelwriter.ico", "x-novelwriter-project.ico"] cpIgnore = shutil.ignore_patterns("__pycache__") - print("Copying: nw") - shutil.copytree("nw", os.path.join(zipDir, "nw"), ignore=cpIgnore) + print("Copying: novelwriter") + shutil.copytree("novelwriter", os.path.join(zipDir, "novelwriter"), ignore=cpIgnore) for copyFile in copyList: print("Copying: %s" % copyFile) shutil.copy2(copyFile, os.path.join(outDir, copyFile)) @@ -613,7 +630,7 @@ def makeSimplePackage(embedPython): # Move assets to outDir as it should not be packed with the rest print("Copying: assets") - os.rename(os.path.join(zipDir, "nw", "assets"), os.path.join(outDir, "assets")) + os.rename(os.path.join(zipDir, "novelwriter", "assets"), os.path.join(outDir, "assets")) print("Writing: __main__.py") with open(os.path.join(zipDir, "__main__.py"), mode="w") as outFile: @@ -629,8 +646,8 @@ def makeSimplePackage(embedPython): " )\n" ")\n\n" "if __name__ == \"__main__\":\n" - " import nw\n" - " nw.main()\n" + " import novelwriter\n" + " novelwriter.main()\n" ) print("") @@ -968,7 +985,7 @@ def winInstall(): targetDir = os.path.abspath(os.path.dirname(__file__)) targetPy = os.path.join(targetDir, "novelWriter.pyw") - targetIcon = os.path.join(targetDir, "nw", "assets", "icons", "novelwriter.ico") + targetIcon = os.path.join(targetDir, "novelwriter", "assets", "icons", "novelwriter.ico") if not os.path.isfile(targetPy): shutil.copy2(os.path.join(targetDir, "novelWriter.py"), targetPy) @@ -1029,7 +1046,9 @@ def winInstall(): winreg.SetValueEx(regKey, kName, 0, winreg.REG_SZ, kVal) winreg.CloseKey(regKey) - mimeIcon = os.path.join(targetDir, "nw", "assets", "icons", "x-novelwriter-project.ico") + mimeIcon = os.path.join( + targetDir, "novelwriter", "assets", "icons", "x-novelwriter-project.ico" + ) mimeExec = '"%s" "%s" "%%1"' % (pythonExe, targetPy) try: diff --git a/tests/README.md b/tests/README.md index 5fb3404e..71028ae5 100644 --- a/tests/README.md +++ b/tests/README.md @@ -37,7 +37,7 @@ xvfb-run pytest-3 -v To add test coverage, run the following: ```bash -pytest-3 -v --cov=nw --cov-report=html +pytest-3 -v --cov=novelwriter --cov-report=html ``` The `--cov-report` switch generates an html report, omit it to print a coverage summary to the @@ -52,9 +52,9 @@ pytest-3 -v -m core Available markers are: -* `base` for unit tests covering the non-gui classes of the `nw` folder.. -* `core` for unit tests covering the classes in the `nw/core` folder. -* `gui` for unit and integrations tests covering the classes in the `nw/gui` folder. +* `base` for unit tests covering the non-gui classes of the `novelwriter` folder.. +* `core` for unit tests covering the classes in the `novelwriter/core` folder. +* `gui` for unit and integrations tests covering the classes in the `novelwriter/gui` folder. You can filter tests further with the `-k` switch, all the way down to a single test. You can for diff --git a/tests/conftest.py b/tests/conftest.py index 7a0deff6..27abd8bd 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -19,21 +19,21 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ +import os import sys import pytest import shutil -import os from mock import MockGuiMain from tools import cleanProject sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) -import nw # noqa: E402 +import novelwriter # noqa: E402 from PyQt5.QtWidgets import QMessageBox # noqa: E402 -from nw.config import Config # noqa: E402 +from novelwriter.config import Config # noqa: E402 ## @@ -145,7 +145,7 @@ def fncConf(fncDir): def mockGUI(monkeypatch, tmpConf): """Create a mock instance of novelWriter's main GUI class. """ - monkeypatch.setattr("nw.CONFIG", tmpConf) + monkeypatch.setattr("novelwriter.CONFIG", tmpConf) theGui = MockGuiMain() theGui.mainConf = tmpConf return theGui @@ -156,8 +156,8 @@ def nwGUI(qtbot, monkeypatch, fncDir, fncConf): """Create an instance of the novelWriter GUI. """ monkeypatch.setattr(QMessageBox, "warning", lambda *a: QMessageBox.Yes) - monkeypatch.setattr("nw.CONFIG", fncConf) - nwGUI = nw.main(["--testmode", "--config=%s" % fncDir, "--data=%s" % fncDir]) + monkeypatch.setattr("novelwriter.CONFIG", fncConf) + nwGUI = novelwriter.main(["--testmode", "--config=%s" % fncDir, "--data=%s" % fncDir]) qtbot.addWidget(nwGUI) nwGUI.show() qtbot.wait(20) diff --git a/tests/test_base/test_base_common.py b/tests/test_base/test_base_common.py index c011f112..bbb0b0db 100644 --- a/tests/test_base/test_base_common.py +++ b/tests/test_base/test_base_common.py @@ -27,7 +27,7 @@ from datetime import datetime from tools import writeFile -from nw.common import ( +from novelwriter.common import ( checkString, checkInt, checkBool, checkHandle, isHandle, isTitleTag, isItemClass, isItemType, isItemLayout, hexToInt, formatInt, formatTimeStamp, formatTime, parseTimeStamp, splitVersionNumber, diff --git a/tests/test_base/test_base_config.py b/tests/test_base/test_base_config.py index 9ac9c488..7c1fa78b 100644 --- a/tests/test_base/test_base_config.py +++ b/tests/test_base/test_base_config.py @@ -28,8 +28,8 @@ from shutil import copyfile from mock import causeOSError, MockApp from tools import cmpFiles, writeFile -from nw.config import Config -from nw.constants import nwConst, nwFiles +from novelwriter.config import Config +from novelwriter.constants import nwConst, nwFiles @pytest.mark.base diff --git a/tests/test_base/test_base_error.py b/tests/test_base/test_base_error.py index afd9c9f3..84a8454d 100644 --- a/tests/test_base/test_base_error.py +++ b/tests/test_base/test_base_error.py @@ -19,14 +19,14 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import pytest +import novelwriter from PyQt5.QtWidgets import QMessageBox, qApp from mock import causeException -from nw.error import NWErrorMessage, exceptionHandler +from novelwriter.error import NWErrorMessage, exceptionHandler @pytest.mark.base @@ -37,7 +37,7 @@ def testBaseError_Dialog(qtbot, monkeypatch, fncDir, tmpDir): monkeypatch.setattr(QMessageBox, "warning", lambda *a: QMessageBox.Yes) qApp.closeAllWindows() - nwGUI = nw.main(["--testmode", "--config=%s" % fncDir, "--data=%s" % tmpDir]) + nwGUI = novelwriter.main(["--testmode", "--config=%s" % fncDir, "--data=%s" % tmpDir]) qtbot.addWidget(nwGUI) nwGUI.show() qtbot.wait(20) @@ -84,7 +84,7 @@ def testBaseError_Handler(qtbot, monkeypatch, fncDir, tmpDir): monkeypatch.setattr(QMessageBox, "warning", lambda *a: QMessageBox.Yes) qApp.closeAllWindows() - nwGUI = nw.main(["--testmode", "--config=%s" % fncDir, "--data=%s" % tmpDir]) + nwGUI = novelwriter.main(["--testmode", "--config=%s" % fncDir, "--data=%s" % tmpDir]) qtbot.addWidget(nwGUI) nwGUI.show() qtbot.wait(20) diff --git a/tests/test_base/test_base_init.py b/tests/test_base/test_base_init.py index 939ec321..e83206e4 100644 --- a/tests/test_base/test_base_init.py +++ b/tests/test_base/test_base_init.py @@ -19,10 +19,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw +import sys import pytest import logging -import sys +import novelwriter from mock import MockGuiMain @@ -31,37 +31,37 @@ from mock import MockGuiMain def testBaseInit_Launch(caplog, monkeypatch, tmpDir): """Check launching the main GUI. """ - monkeypatch.setattr("nw.guimain.GuiMain", MockGuiMain) + monkeypatch.setattr("novelwriter.guimain.GuiMain", MockGuiMain) # TestMode Launch - nwGUI = nw.main(["--testmode", "--config=%s" % tmpDir, "--data=%s" % tmpDir]) + nwGUI = novelwriter.main(["--testmode", "--config=%s" % tmpDir, "--data=%s" % tmpDir]) assert isinstance(nwGUI, MockGuiMain) # Darwin Launch caplog.clear() - osDarwin = nw.CONFIG.osDarwin - nw.CONFIG.osDarwin = True + osDarwin = novelwriter.CONFIG.osDarwin + novelwriter.CONFIG.osDarwin = True with monkeypatch.context() as mp: mp.setitem(sys.modules, "Foundation", None) - nwGUI = nw.main(["--testmode", "--config=%s" % tmpDir, "--data=%s" % tmpDir]) + nwGUI = novelwriter.main(["--testmode", "--config=%s" % tmpDir, "--data=%s" % tmpDir]) assert isinstance(nwGUI, MockGuiMain) assert "Failed" in caplog.text - nw.CONFIG.osDarwin = osDarwin + novelwriter.CONFIG.osDarwin = osDarwin # Windows Launch caplog.clear() - osWindows = nw.CONFIG.osWindows - nw.CONFIG.osWindows = True + osWindows = novelwriter.CONFIG.osWindows + novelwriter.CONFIG.osWindows = True with monkeypatch.context() as mp: mp.setitem(sys.modules, "ctypes", None) - nwGUI = nw.main(["--testmode", "--config=%s" % tmpDir, "--data=%s" % tmpDir]) + nwGUI = novelwriter.main(["--testmode", "--config=%s" % tmpDir, "--data=%s" % tmpDir]) assert isinstance(nwGUI, MockGuiMain) if not sys.platform.startswith("darwin"): # For some reason, the test doesn't work on macOS assert "Failed" in caplog.text - nw.CONFIG.osWindows = osWindows + novelwriter.CONFIG.osWindows = osWindows # Normal Launch monkeypatch.setattr("PyQt5.QtWidgets.QApplication.__init__", lambda *a: None) @@ -71,7 +71,7 @@ def testBaseInit_Launch(caplog, monkeypatch, tmpDir): monkeypatch.setattr("PyQt5.QtWidgets.QApplication.setOrganizationDomain", lambda *a: None) monkeypatch.setattr("PyQt5.QtWidgets.QApplication.exec_", lambda *a: 0) with pytest.raises(SystemExit) as ex: - nw.main(["--config=%s" % tmpDir, "--data=%s" % tmpDir]) + novelwriter.main(["--config=%s" % tmpDir, "--data=%s" % tmpDir]) assert ex.value.code == 0 # END Test testBaseInit_Launch @@ -81,52 +81,52 @@ def testBaseInit_Launch(caplog, monkeypatch, tmpDir): def testBaseInit_Options(monkeypatch, tmpDir): """Test command line options for logging level. """ - monkeypatch.setattr("nw.guimain.GuiMain", MockGuiMain) + monkeypatch.setattr("novelwriter.guimain.GuiMain", MockGuiMain) monkeypatch.setattr(sys, "argv", [ "novelWriter.py", "--testmode", "--config=%s" % tmpDir, "--data=%s" % tmpDir ]) # Defaults w/None Args - nwGUI = nw.main() - assert nw.logger.getEffectiveLevel() == logging.WARNING + nwGUI = novelwriter.main() + assert novelwriter.logger.getEffectiveLevel() == logging.WARNING assert nwGUI.closeMain() == "closeMain" # Defaults - nwGUI = nw.main( + nwGUI = novelwriter.main( ["--testmode", "--config=%s" % tmpDir, "--data=%s" % tmpDir, "--style=Fusion"] ) - assert nw.logger.getEffectiveLevel() == logging.WARNING + assert novelwriter.logger.getEffectiveLevel() == logging.WARNING assert nwGUI.closeMain() == "closeMain" # Log Levels - nwGUI = nw.main( + nwGUI = novelwriter.main( ["--testmode", "--info", "--config=%s" % tmpDir, "--data=%s" % tmpDir] ) - assert nw.logger.getEffectiveLevel() == logging.INFO + assert novelwriter.logger.getEffectiveLevel() == logging.INFO assert nwGUI.closeMain() == "closeMain" - nwGUI = nw.main( + nwGUI = novelwriter.main( ["--testmode", "--debug", "--config=%s" % tmpDir, "--data=%s" % tmpDir] ) - assert nw.logger.getEffectiveLevel() == logging.DEBUG + assert novelwriter.logger.getEffectiveLevel() == logging.DEBUG assert nwGUI.closeMain() == "closeMain" - nwGUI = nw.main( + nwGUI = novelwriter.main( ["--testmode", "--verbose", "--config=%s" % tmpDir, "--data=%s" % tmpDir] ) - assert nw.logger.getEffectiveLevel() == 5 + assert novelwriter.logger.getEffectiveLevel() == 5 assert nwGUI.closeMain() == "closeMain" # Help and Version with pytest.raises(SystemExit) as ex: - nwGUI = nw.main( + nwGUI = novelwriter.main( ["--testmode", "--help", "--config=%s" % tmpDir, "--data=%s" % tmpDir] ) assert nwGUI.closeMain() == "closeMain" assert ex.value.code == 0 with pytest.raises(SystemExit) as ex: - nwGUI = nw.main( + nwGUI = novelwriter.main( ["--testmode", "--version", "--config=%s" % tmpDir, "--data=%s" % tmpDir] ) assert nwGUI.closeMain() == "closeMain" @@ -134,17 +134,17 @@ def testBaseInit_Options(monkeypatch, tmpDir): # Invalid options with pytest.raises(SystemExit) as ex: - nwGUI = nw.main( + nwGUI = novelwriter.main( ["--testmode", "--invalid", "--config=%s" % tmpDir, "--data=%s" % tmpDir] ) assert nwGUI.closeMain() == "closeMain" assert ex.value.code == 2 # Project Path - nwGUI = nw.main( + nwGUI = novelwriter.main( ["--testmode", "--config=%s" % tmpDir, "--data=%s" % tmpDir, "sample/"] ) - assert nw.CONFIG.cmdOpen == "sample/" + assert novelwriter.CONFIG.cmdOpen == "sample/" assert nwGUI.closeMain() == "closeMain" # END Test testBaseInit_Options @@ -154,19 +154,19 @@ def testBaseInit_Options(monkeypatch, tmpDir): def testBaseInit_Imports(caplog, monkeypatch, tmpDir): """Check import error handling. """ - monkeypatch.setattr("nw.guimain.GuiMain", MockGuiMain) - monkeypatch.setattr("PyQt5.QtWidgets.QApplication.__init__", lambda *args: None) - monkeypatch.setattr("PyQt5.QtWidgets.QApplication.exec_", lambda *args: 0) - monkeypatch.setattr("PyQt5.QtWidgets.QErrorMessage.__init__", lambda *args: None) - monkeypatch.setattr("PyQt5.QtWidgets.QErrorMessage.resize", lambda *args: None) - monkeypatch.setattr("PyQt5.QtWidgets.QErrorMessage.showMessage", lambda *args: None) + monkeypatch.setattr("novelwriter.guimain.GuiMain", MockGuiMain) + monkeypatch.setattr("PyQt5.QtWidgets.QApplication.__init__", lambda *a: None) + monkeypatch.setattr("PyQt5.QtWidgets.QApplication.exec_", lambda *a: 0) + monkeypatch.setattr("PyQt5.QtWidgets.QErrorMessage.__init__", lambda *a: None) + monkeypatch.setattr("PyQt5.QtWidgets.QErrorMessage.resize", lambda *a: None) + monkeypatch.setattr("PyQt5.QtWidgets.QErrorMessage.showMessage", lambda *a: None) monkeypatch.setitem(sys.modules, "lxml", None) monkeypatch.setattr("sys.hexversion", 0x0) - monkeypatch.setattr("nw.CONFIG.verQtValue", 50000) - monkeypatch.setattr("nw.CONFIG.verPyQtValue", 50000) + monkeypatch.setattr("novelwriter.CONFIG.verQtValue", 50000) + monkeypatch.setattr("novelwriter.CONFIG.verPyQtValue", 50000) with pytest.raises(SystemExit) as ex: - _ = nw.main( + _ = novelwriter.main( ["--testmode", "--config=%s" % tmpDir, "--data=%s" % tmpDir] ) diff --git a/tests/test_core/test_core_document.py b/tests/test_core/test_core_document.py index ff33b12f..448c13e7 100644 --- a/tests/test_core/test_core_document.py +++ b/tests/test_core/test_core_document.py @@ -25,8 +25,8 @@ import pytest from mock import causeOSError from tools import readFile -from nw.core import NWProject, NWDoc -from nw.enum import nwItemClass, nwItemLayout +from novelwriter.core import NWProject, NWDoc +from novelwriter.enum import nwItemClass, nwItemLayout @pytest.mark.core diff --git a/tests/test_core/test_core_index.py b/tests/test_core/test_core_index.py index 41a66230..a7ea82e5 100644 --- a/tests/test_core/test_core_index.py +++ b/tests/test_core/test_core_index.py @@ -28,9 +28,9 @@ from shutil import copyfile from mock import causeException from tools import cmpFiles -from nw.core.project import NWProject -from nw.core.index import NWIndex, countWords -from nw.enum import nwItemClass, nwItemLayout +from novelwriter.core.project import NWProject +from novelwriter.core.index import NWIndex, countWords +from novelwriter.enum import nwItemClass, nwItemLayout @pytest.mark.core diff --git a/tests/test_core/test_core_item.py b/tests/test_core/test_core_item.py index fb12e719..2c0515b7 100644 --- a/tests/test_core/test_core_item.py +++ b/tests/test_core/test_core_item.py @@ -23,9 +23,9 @@ import pytest from lxml import etree -from nw.core import NWProject -from nw.core.item import NWItem -from nw.enum import nwItemClass, nwItemType, nwItemLayout +from novelwriter.core import NWProject +from novelwriter.core.item import NWItem +from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout @pytest.mark.core diff --git a/tests/test_core/test_core_options.py b/tests/test_core/test_core_options.py index 65d46cc1..41e0933d 100644 --- a/tests/test_core/test_core_options.py +++ b/tests/test_core/test_core_options.py @@ -26,9 +26,9 @@ import pytest from mock import causeOSError from tools import writeFile -from nw.core import NWProject -from nw.core.options import OptionState -from nw.constants import nwFiles +from novelwriter.core import NWProject +from novelwriter.core.options import OptionState +from novelwriter.constants import nwFiles @pytest.mark.core diff --git a/tests/test_core/test_core_project.py b/tests/test_core/test_core_project.py index 0f03415a..3726a1d4 100644 --- a/tests/test_core/test_core_project.py +++ b/tests/test_core/test_core_project.py @@ -29,10 +29,10 @@ from lxml import etree from tools import cmpFiles, writeFile, readFile from mock import causeOSError -from nw.core.project import NWProject -from nw.enum import nwItemClass, nwItemType, nwItemLayout -from nw.common import formatTimeStamp -from nw.constants import nwFiles +from novelwriter.core.project import NWProject +from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout +from novelwriter.common import formatTimeStamp +from novelwriter.constants import nwFiles @pytest.mark.core @@ -234,7 +234,7 @@ def testCoreProject_NewSampleB(monkeypatch, fncDir, tmpConf, mockGUI, tmpDir): theProject = NWProject(mockGUI) theProject.projTree.setSeed(42) - # Make sure we do not pick up the nw/assets/sample.zip file + # Make sure we do not pick up the novelwriter/assets/sample.zip file tmpConf.assetPath = tmpDir # Set a fake project file name @@ -531,7 +531,7 @@ def testCoreProject_LockFile(monkeypatch, fncDir, mockGUI): # Write lock file with monkeypatch.context() as mp: - mp.setattr("nw.core.project.time", lambda: 123.4) + mp.setattr("novelwriter.core.project.time", lambda: 123.4) assert theProject._writeLockFile() is True assert readFile(lockFile) == "TestHost\nTestOS\n1.0\n123\n" @@ -730,7 +730,7 @@ def testCoreProject_Methods(monkeypatch, nwMinimal, mockGUI, tmpDir): theProject.editTime = 1234 theProject.projOpened = 1600000000 with monkeypatch.context() as mp: - mp.setattr("nw.core.project.time", lambda: 1600005600) + mp.setattr("novelwriter.core.project.time", lambda: 1600005600) assert theProject.getCurrentEditTime() == 6834 # Trash folder @@ -892,7 +892,7 @@ def testCoreProject_Methods(monkeypatch, nwMinimal, mockGUI, tmpDir): theProject.notesWCount = 100 with monkeypatch.context() as mp: - mp.setattr("nw.core.project.time", lambda: 1600005600) + mp.setattr("novelwriter.core.project.time", lambda: 1600005600) assert theProject._appendSessionStats(idleTime=99) assert readFile(statsFile) == ( diff --git a/tests/test_core/test_core_spell.py b/tests/test_core/test_core_spell.py index 32246fd3..79723806 100644 --- a/tests/test_core/test_core_spell.py +++ b/tests/test_core/test_core_spell.py @@ -26,7 +26,9 @@ import pytest from mock import causeOSError from tools import readFile, writeFile -from nw.core.spellcheck import NWSpellCheck, NWSpellEnchant, NWSpellSimple +from novelwriter.core.spellcheck import ( + NWSpellCheck, NWSpellEnchant, NWSpellSimple +) @pytest.mark.core diff --git a/tests/test_core/test_core_status.py b/tests/test_core/test_core_status.py index 8d145f10..2512ced7 100644 --- a/tests/test_core/test_core_status.py +++ b/tests/test_core/test_core_status.py @@ -23,7 +23,7 @@ import pytest from lxml import etree -from nw.core.status import NWStatus +from novelwriter.core.status import NWStatus @pytest.mark.core diff --git a/tests/test_core/test_core_tohtml.py b/tests/test_core/test_core_tohtml.py index 011c18e7..d0450147 100644 --- a/tests/test_core/test_core_tohtml.py +++ b/tests/test_core/test_core_tohtml.py @@ -24,7 +24,7 @@ import pytest from tools import readFile -from nw.core import NWProject, NWIndex, ToHtml +from novelwriter.core import NWProject, NWIndex, ToHtml @pytest.mark.core diff --git a/tests/test_core/test_core_tokenizer.py b/tests/test_core/test_core_tokenizer.py index 1527c1ee..28c1316f 100644 --- a/tests/test_core/test_core_tokenizer.py +++ b/tests/test_core/test_core_tokenizer.py @@ -24,8 +24,8 @@ import pytest from tools import readFile -from nw.core import NWProject, NWDoc -from nw.core.tokenizer import Tokenizer +from novelwriter.core import NWProject, NWDoc +from novelwriter.core.tokenizer import Tokenizer @pytest.mark.core @@ -183,7 +183,7 @@ def testCoreToken_TextOps(monkeypatch, nwMinimal, mockGUI): assert theToken.theText == docText with monkeypatch.context() as mp: - mp.setattr("nw.constants.nwConst.MAX_DOCSIZE", 100) + mp.setattr("novelwriter.constants.nwConst.MAX_DOCSIZE", 100) assert theToken.setText(sHandle, docText) is True assert theToken.theText == ( "# ERROR\n\n" diff --git a/tests/test_core/test_core_toodt.py b/tests/test_core/test_core_toodt.py index f9c551e3..ca3c0d8a 100644 --- a/tests/test_core/test_core_toodt.py +++ b/tests/test_core/test_core_toodt.py @@ -28,8 +28,8 @@ from shutil import copyfile from tools import cmpFiles -from nw.core import NWProject, NWIndex, ToOdt -from nw.core.toodt import ODTParagraphStyle, ODTTextStyle, XMLParagraph, _mkTag +from novelwriter.core import NWProject, NWIndex, ToOdt +from novelwriter.core.toodt import ODTParagraphStyle, ODTTextStyle, XMLParagraph, _mkTag XML_NS = [ ' xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"', diff --git a/tests/test_core/test_core_tree.py b/tests/test_core/test_core_tree.py index 36d58477..284d9267 100644 --- a/tests/test_core/test_core_tree.py +++ b/tests/test_core/test_core_tree.py @@ -27,9 +27,9 @@ from hashlib import sha256 from tools import readFile -from nw.core.project import NWProject, NWItem, NWTree -from nw.enum import nwItemClass, nwItemType, nwItemLayout -from nw.constants import nwFiles +from novelwriter.core.project import NWProject, NWItem, NWTree +from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout +from novelwriter.constants import nwFiles @pytest.fixture(scope="function") @@ -283,7 +283,7 @@ def testCoreTree_MakeHandles(monkeypatch, mockGUI): # Fix the time() function and force a handle collission theTree.setSeed(None) theTree._handleCount = 0 - monkeypatch.setattr("nw.core.tree.time", lambda: 123.4) + monkeypatch.setattr("novelwriter.core.tree.time", lambda: 123.4) tHandle = theTree._makeHandle() theTree._projTree[tHandle] = None diff --git a/tests/test_dialogs/test_dlg_about.py b/tests/test_dialogs/test_dlg_about.py index bf2c18af..76f66984 100644 --- a/tests/test_dialogs/test_dlg_about.py +++ b/tests/test_dialogs/test_dlg_about.py @@ -25,7 +25,7 @@ from tools import getGuiItem from PyQt5.QtWidgets import QAction, QMessageBox -from nw.dialogs import GuiAbout +from novelwriter.dialogs import GuiAbout keyDelay = 2 typeDelay = 1 diff --git a/tests/test_dialogs/test_dlg_dialogs.py b/tests/test_dialogs/test_dlg_dialogs.py index 6a652eb4..d075f062 100644 --- a/tests/test_dialogs/test_dlg_dialogs.py +++ b/tests/test_dialogs/test_dlg_dialogs.py @@ -24,7 +24,7 @@ import pytest from PyQt5.QtCore import QItemSelectionModel from PyQt5.QtWidgets import QAction, QListWidgetItem, QDialog, QMessageBox -from nw.dialogs import GuiQuoteSelect, GuiUpdates +from novelwriter.dialogs import GuiQuoteSelect, GuiUpdates keyDelay = 2 typeDelay = 1 @@ -86,11 +86,11 @@ def testDlgOther_Updates(qtbot, monkeypatch, nwGUI): return mockPayload() # Faulty Return - monkeypatch.setattr("nw.dialogs.updates.urlopen", mockUrlopenA) + monkeypatch.setattr("novelwriter.dialogs.updates.urlopen", mockUrlopenA) nwUpdate.checkLatest() # Valid Return - monkeypatch.setattr("nw.dialogs.updates.urlopen", mockUrlopenB) + monkeypatch.setattr("novelwriter.dialogs.updates.urlopen", mockUrlopenB) nwUpdate.checkLatest() assert nwUpdate.latestValue.text().startswith("novelWriter v1.0") diff --git a/tests/test_dialogs/test_dlg_itemeditor.py b/tests/test_dialogs/test_dlg_itemeditor.py index c65db492..5c6d2277 100644 --- a/tests/test_dialogs/test_dlg_itemeditor.py +++ b/tests/test_dialogs/test_dlg_itemeditor.py @@ -27,9 +27,9 @@ from tools import cmpFiles, getGuiItem from PyQt5.QtWidgets import QAction, QMessageBox -from nw.gui import GuiProjectTree -from nw.enum import nwItemLayout -from nw.dialogs import GuiItemEditor +from novelwriter.gui import GuiProjectTree +from novelwriter.enum import nwItemLayout +from novelwriter.dialogs import GuiItemEditor keyDelay = 2 typeDelay = 1 diff --git a/tests/test_dialogs/test_dlg_merge.py b/tests/test_dialogs/test_dlg_merge.py index 039e0654..17f566e9 100644 --- a/tests/test_dialogs/test_dlg_merge.py +++ b/tests/test_dialogs/test_dlg_merge.py @@ -27,9 +27,9 @@ from mock import causeOSError from PyQt5.QtWidgets import QAction, QMessageBox, QDialog -from nw.dialogs import GuiDocMerge, GuiItemEditor -from nw.enum import nwItemType, nwWidget -from nw.core.tree import NWTree +from novelwriter.dialogs import GuiDocMerge, GuiItemEditor +from novelwriter.enum import nwItemType, nwWidget +from novelwriter.core.tree import NWTree keyDelay = 2 typeDelay = 1 diff --git a/tests/test_dialogs/test_dlg_preferences.py b/tests/test_dialogs/test_dlg_preferences.py index 497b4c45..b681133e 100644 --- a/tests/test_dialogs/test_dlg_preferences.py +++ b/tests/test_dialogs/test_dlg_preferences.py @@ -19,9 +19,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw -import pytest import os +import pytest +import novelwriter from shutil import copyfile from tools import cmpFiles, getGuiItem @@ -31,9 +31,9 @@ from PyQt5.QtWidgets import ( QDialogButtonBox, QDialog, QAction, QFileDialog, QFontDialog, QMessageBox ) -from nw.config import Config -from nw.dialogs import GuiPreferences, GuiQuoteSelect -from nw.constants import nwConst +from novelwriter.config import Config +from novelwriter.dialogs import GuiPreferences, GuiQuoteSelect +from novelwriter.constants import nwConst keyDelay = 2 typeDelay = 1 @@ -50,17 +50,17 @@ def testDlgPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir): monkeypatch.setattr(QMessageBox, "information", lambda *a: QMessageBox.Yes) # Must create a clean config and GUI object as the test-wide - # nw.CONFIG object is created on import an can be tainted by other tests + # novelwriter.CONFIG object is created on import an can be tainted by other tests confFile = os.path.join(fncDir, "novelwriter.conf") if os.path.isfile(confFile): os.unlink(confFile) theConf = Config() theConf.initConfig(fncDir, fncDir) theConf.setLastPath("") - origConf = nw.CONFIG - nw.CONFIG = theConf + origConf = novelwriter.CONFIG + novelwriter.CONFIG = theConf - nwGUI = nw.main(["--testmode", "--config=%s" % fncDir, "--data=%s" % fncDir]) + nwGUI = novelwriter.main(["--testmode", "--config=%s" % fncDir, "--data=%s" % fncDir]) qtbot.addWidget(nwGUI) nwGUI.show() qtbot.wait(stepDelay) @@ -253,7 +253,7 @@ def testDlgPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir): assert cmpFiles(testFile, compFile, ignoreLines) # Clean up - nw.CONFIG = origConf + novelwriter.CONFIG = origConf nwGUI.closeMain() # qtbot.stopForInteraction() diff --git a/tests/test_dialogs/test_dlg_projload.py b/tests/test_dialogs/test_dlg_projload.py index 0dcc6d79..beb96bb8 100644 --- a/tests/test_dialogs/test_dlg_projload.py +++ b/tests/test_dialogs/test_dlg_projload.py @@ -30,7 +30,7 @@ from PyQt5.QtWidgets import ( QMessageBox ) -from nw.dialogs import GuiProjectLoad +from novelwriter.dialogs import GuiProjectLoad keyDelay = 2 typeDelay = 1 diff --git a/tests/test_dialogs/test_dlg_projsettings.py b/tests/test_dialogs/test_dlg_projsettings.py index acdfad21..4fc6f98a 100644 --- a/tests/test_dialogs/test_dlg_projsettings.py +++ b/tests/test_dialogs/test_dlg_projsettings.py @@ -31,7 +31,7 @@ from PyQt5.QtWidgets import ( QDialog, QAction, QMessageBox, QColorDialog, QTreeWidgetItem ) -from nw.dialogs import GuiProjectSettings +from novelwriter.dialogs import GuiProjectSettings keyDelay = 2 typeDelay = 1 diff --git a/tests/test_dialogs/test_dlg_split.py b/tests/test_dialogs/test_dlg_split.py index 6b8f1f7d..32a9d138 100644 --- a/tests/test_dialogs/test_dlg_split.py +++ b/tests/test_dialogs/test_dlg_split.py @@ -27,10 +27,10 @@ from mock import causeOSError from PyQt5.QtWidgets import QAction, QMessageBox, QDialog -from nw.dialogs import GuiDocSplit, GuiItemEditor -from nw.enum import nwItemType, nwWidget -from nw.core.document import NWDoc -from nw.core.tree import NWTree +from novelwriter.dialogs import GuiDocSplit, GuiItemEditor +from novelwriter.enum import nwItemType, nwWidget +from novelwriter.core.document import NWDoc +from novelwriter.core.tree import NWTree keyDelay = 2 typeDelay = 1 diff --git a/tests/test_dialogs/test_dlg_wordlist.py b/tests/test_dialogs/test_dlg_wordlist.py index c854f073..e76a9f4f 100644 --- a/tests/test_dialogs/test_dlg_wordlist.py +++ b/tests/test_dialogs/test_dlg_wordlist.py @@ -28,8 +28,8 @@ from PyQt5.QtWidgets import QDialog, QMessageBox, QAction from tools import writeFile, readFile, getGuiItem from mock import causeOSError -from nw.dialogs import GuiWordList -from nw.constants import nwFiles +from novelwriter.dialogs import GuiWordList +from novelwriter.constants import nwFiles keyDelay = 2 typeDelay = 1 diff --git a/tests/test_gui/test_gui_doceditor.py b/tests/test_gui/test_gui_doceditor.py index 4cb48e90..b27c2829 100644 --- a/tests/test_gui/test_gui_doceditor.py +++ b/tests/test_gui/test_gui_doceditor.py @@ -27,9 +27,9 @@ from PyQt5.QtCore import Qt from PyQt5.QtGui import QTextBlock, QTextCursor, QTextOption from PyQt5.QtWidgets import QAction, QMessageBox, qApp -from nw.gui.doceditor import GuiDocEditor -from nw.enum import nwDocAction, nwDocInsert, nwItemClass, nwItemLayout -from nw.constants import nwKeyWords, nwUnicode +from novelwriter.gui.doceditor import GuiDocEditor +from novelwriter.enum import nwDocAction, nwDocInsert, nwItemClass, nwItemLayout +from novelwriter.constants import nwKeyWords, nwUnicode keyDelay = 2 typeDelay = 1 @@ -110,7 +110,7 @@ def testGuiEditor_LoadText(qtbot, monkeypatch, caplog, nwGUI, nwMinimal, ipsumTe # Document too big with monkeypatch.context() as mp: - mp.setattr("nw.constants.nwConst.MAX_DOCSIZE", 100) + mp.setattr("novelwriter.constants.nwConst.MAX_DOCSIZE", 100) assert nwGUI.docEditor.loadText(sHandle) is False assert "The document you are trying to open is too big." in caplog.text @@ -120,7 +120,7 @@ def testGuiEditor_LoadText(qtbot, monkeypatch, caplog, nwGUI, nwMinimal, ipsumTe # Reload too big text with monkeypatch.context() as mp: - mp.setattr("nw.constants.nwConst.MAX_DOCSIZE", 100) + mp.setattr("novelwriter.constants.nwConst.MAX_DOCSIZE", 100) assert nwGUI.docEditor.replaceText(longText) is False assert "The document you are trying to open is too big." in caplog.text diff --git a/tests/test_gui/test_gui_docviewer.py b/tests/test_gui/test_gui_docviewer.py index 98276853..c7f42654 100644 --- a/tests/test_gui/test_gui_docviewer.py +++ b/tests/test_gui/test_gui_docviewer.py @@ -25,7 +25,7 @@ from PyQt5.QtCore import Qt, QUrl from PyQt5.QtGui import QTextCursor from PyQt5.QtWidgets import qApp, QAction, QMessageBox -from nw.enum import nwDocAction +from novelwriter.enum import nwDocAction keyDelay = 2 typeDelay = 1 diff --git a/tests/test_gui/test_gui_guimain.py b/tests/test_gui/test_gui_guimain.py index 8d363a3d..0087993e 100644 --- a/tests/test_gui/test_gui_guimain.py +++ b/tests/test_gui/test_gui_guimain.py @@ -28,10 +28,10 @@ from tools import cmpFiles from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QMessageBox, QDialog -from nw.dialogs.itemeditor import GuiItemEditor -from nw.gui.doceditor import GuiDocEditor -from nw.gui.projtree import GuiProjectTree -from nw.enum import nwItemType, nwWidget +from novelwriter.dialogs.itemeditor import GuiItemEditor +from novelwriter.gui.doceditor import GuiDocEditor +from novelwriter.gui.projtree import GuiProjectTree +from novelwriter.enum import nwItemType, nwWidget keyDelay = 2 typeDelay = 1 @@ -43,12 +43,12 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, fncProj, refDir, outDir): """Test the document editor. """ # Block message box - monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes) - monkeypatch.setattr(QMessageBox, "information", lambda *args: QMessageBox.Yes) - monkeypatch.setattr(GuiItemEditor, "exec_", lambda *args: None) - monkeypatch.setattr(GuiItemEditor, "result", lambda *args: QDialog.Accepted) - monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *args: True) - monkeypatch.setattr(GuiDocEditor, "hasFocus", lambda *args: True) + monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes) + monkeypatch.setattr(QMessageBox, "information", lambda *a: QMessageBox.Yes) + monkeypatch.setattr(GuiItemEditor, "exec_", lambda *a: None) + monkeypatch.setattr(GuiItemEditor, "result", lambda *a: QDialog.Accepted) + monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *a: True) + monkeypatch.setattr(GuiDocEditor, "hasFocus", lambda *a: True) # Create new, save, close project nwGUI.theProject.projTree.setSeed(42) diff --git a/tests/test_gui/test_gui_mainmenu.py b/tests/test_gui/test_gui_mainmenu.py index 4bbef2c5..2b65d1f5 100644 --- a/tests/test_gui/test_gui_mainmenu.py +++ b/tests/test_gui/test_gui_mainmenu.py @@ -28,9 +28,9 @@ from PyQt5.QtWidgets import QAction, QFileDialog, QMessageBox from tools import writeFile -from nw.gui.doceditor import GuiDocEditor -from nw.enum import nwDocAction, nwDocInsert, nwWidget -from nw.constants import nwKeyWords, nwUnicode +from novelwriter.gui.doceditor import GuiDocEditor +from novelwriter.enum import nwDocAction, nwDocInsert, nwWidget +from novelwriter.constants import nwKeyWords, nwUnicode keyDelay = 2 typeDelay = 1 diff --git a/tests/test_gui/test_gui_outline.py b/tests/test_gui/test_gui_outline.py index ee1c81db..3eda540e 100644 --- a/tests/test_gui/test_gui_outline.py +++ b/tests/test_gui/test_gui_outline.py @@ -24,7 +24,7 @@ import pytest from PyQt5.QtCore import Qt, QPoint from PyQt5.QtWidgets import QAction, QTreeWidgetItem, QMessageBox -from nw.enum import nwOutline +from novelwriter.enum import nwOutline keyDelay = 2 typeDelay = 1 diff --git a/tests/test_gui/test_gui_projdetails.py b/tests/test_gui/test_gui_projdetails.py index ae20e613..7ecf3d3e 100644 --- a/tests/test_gui/test_gui_projdetails.py +++ b/tests/test_gui/test_gui_projdetails.py @@ -25,7 +25,7 @@ from tools import getGuiItem from PyQt5.QtWidgets import QAction, QMessageBox -from nw.gui import GuiProjectDetails +from novelwriter.gui import GuiProjectDetails keyDelay = 2 typeDelay = 1 diff --git a/tests/test_gui/test_gui_projtree.py b/tests/test_gui/test_gui_projtree.py index f73de6d6..40c9f26b 100644 --- a/tests/test_gui/test_gui_projtree.py +++ b/tests/test_gui/test_gui_projtree.py @@ -27,9 +27,9 @@ from tools import writeFile from PyQt5.QtCore import QItemSelectionModel from PyQt5.QtWidgets import QAction, QMessageBox -from nw.guimain import GuiMain -from nw.gui.projtree import GuiProjectTree -from nw.enum import nwItemType, nwItemClass +from novelwriter.guimain import GuiMain +from novelwriter.gui.projtree import GuiProjectTree +from novelwriter.enum import nwItemType, nwItemClass @pytest.mark.gui @@ -86,7 +86,7 @@ def testGuiProjTree_TreeItems(qtbot, caplog, monkeypatch, nwGUI, nwMinimal): assert nwTree.newTreeItem(nwItemType.ROOT, nwItemClass.CUSTOM) # Valid # Change max depth and try to add a subfolder that is too deep - monkeypatch.setattr("nw.constants.nwConst.MAX_DEPTH", 2) + monkeypatch.setattr("novelwriter.constants.nwConst.MAX_DEPTH", 2) chItem = nwTree._getTreeItem("71ee45a3c0db9") nwTree.setCurrentItem(chItem, QItemSelectionModel.Current) assert not nwTree.newTreeItem(nwItemType.FOLDER, None) @@ -228,7 +228,7 @@ def testGuiProjTree_TreeItems(qtbot, caplog, monkeypatch, nwGUI, nwMinimal): nwTree.clearSelection() # Add a file with no parent, and fail to find a suitable parent item - monkeypatch.setattr("nw.core.tree.NWTree.findRoot", lambda *a: None) + monkeypatch.setattr("novelwriter.core.tree.NWTree.findRoot", lambda *a: None) assert not nwTree.newTreeItem(nwItemType.FILE, nwItemClass.NOVEL) assert not nwTree.newTreeItem(nwItemType.FOLDER, nwItemClass.NOVEL) diff --git a/tests/test_gui/test_gui_theme.py b/tests/test_gui/test_gui_theme.py index 360fd854..bc99d900 100644 --- a/tests/test_gui/test_gui_theme.py +++ b/tests/test_gui/test_gui_theme.py @@ -19,8 +19,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -import nw import pytest +import novelwriter from PyQt5.QtGui import QColor, QPixmap, QIcon from PyQt5.QtWidgets import QStyle, QMessageBox @@ -38,40 +38,44 @@ def testGuiTheme_Main(qtbot, monkeypatch, nwMinimal, tmpDir): monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes) monkeypatch.setattr(QMessageBox, "warning", lambda *a: QMessageBox.Yes) - nwGUI = nw.main(["--testmode", "--config=%s" % nwMinimal, "--data=%s" % tmpDir, nwMinimal]) + nwGUI = novelwriter.main( + ["--testmode", "--config=%s" % nwMinimal, "--data=%s" % tmpDir, nwMinimal] + ) qtbot.addWidget(nwGUI) nwGUI.show() qtbot.wait(stepDelay) # Change Settings - assert nw.CONFIG.confPath == nwMinimal - nw.CONFIG.guiTheme = "default_dark" - nw.CONFIG.guiSyntax = "tomorrow_night_eighties" - nw.CONFIG.guiIcons = "typicons_colour_dark" - nw.CONFIG.guiDark = True - nw.CONFIG.guiFont = "Cantarell" - nw.CONFIG.guiFontSize = 11 - nw.CONFIG.confChanged = True - assert nw.CONFIG.saveConfig() + assert novelwriter.CONFIG.confPath == nwMinimal + novelwriter.CONFIG.guiTheme = "default_dark" + novelwriter.CONFIG.guiSyntax = "tomorrow_night_eighties" + novelwriter.CONFIG.guiIcons = "typicons_colour_dark" + novelwriter.CONFIG.guiDark = True + novelwriter.CONFIG.guiFont = "Cantarell" + novelwriter.CONFIG.guiFontSize = 11 + novelwriter.CONFIG.confChanged = True + assert novelwriter.CONFIG.saveConfig() nwGUI.closeMain() nwGUI.close() del nwGUI # Re-open - assert nw.CONFIG.confPath == nwMinimal - nwGUI = nw.main(["--testmode", "--config=%s" % nwMinimal, "--data=%s" % tmpDir, nwMinimal]) + assert novelwriter.CONFIG.confPath == nwMinimal + nwGUI = novelwriter.main( + ["--testmode", "--config=%s" % nwMinimal, "--data=%s" % tmpDir, nwMinimal] + ) assert nwGUI.mainConf.confPath == nwMinimal qtbot.addWidget(nwGUI) nwGUI.show() qtbot.wait(stepDelay) - assert nw.CONFIG.guiTheme == "default_dark" - assert nw.CONFIG.guiSyntax == "tomorrow_night_eighties" - assert nw.CONFIG.guiIcons == "typicons_colour_dark" - assert nw.CONFIG.guiDark is True - assert nw.CONFIG.guiFont == "Cantarell" - assert nw.CONFIG.guiFontSize == 11 + assert novelwriter.CONFIG.guiTheme == "default_dark" + assert novelwriter.CONFIG.guiSyntax == "tomorrow_night_eighties" + assert novelwriter.CONFIG.guiIcons == "typicons_colour_dark" + assert novelwriter.CONFIG.guiDark is True + assert novelwriter.CONFIG.guiFont == "Cantarell" + assert novelwriter.CONFIG.guiFontSize == 11 # Check GUI Colours thePalette = nwGUI.palette() @@ -114,9 +118,9 @@ def testGuiTheme_Main(qtbot, monkeypatch, nwMinimal, tmpDir): # Test Icon class theIcons = nwGUI.theTheme.theIcons - nw.CONFIG.guiIcons = "invalid" + novelwriter.CONFIG.guiIcons = "invalid" assert not theIcons.updateTheme() - nw.CONFIG.guiIcons = "typicons_colour_dark" + novelwriter.CONFIG.guiIcons = "typicons_colour_dark" assert theIcons.updateTheme() # Ask for a non-existent key diff --git a/tests/test_tools/test_tools_build.py b/tests/test_tools/test_tools_build.py index f91625c7..b89ad8df 100644 --- a/tests/test_tools/test_tools_build.py +++ b/tests/test_tools/test_tools_build.py @@ -28,7 +28,7 @@ from tools import cmpFiles, getGuiItem from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QAction, QMessageBox, QFileDialog -from nw.tools import GuiBuildNovel +from novelwriter.tools import GuiBuildNovel keyDelay = 2 typeDelay = 1 diff --git a/tests/test_tools/test_tools_projwizard.py b/tests/test_tools/test_tools_projwizard.py index 2e6a76d4..e77a6556 100644 --- a/tests/test_tools/test_tools_projwizard.py +++ b/tests/test_tools/test_tools_projwizard.py @@ -28,8 +28,8 @@ from tools import getGuiItem from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QFileDialog, QWizard, QMessageBox -from nw.enum import nwItemClass -from nw.tools.projwizard import ( +from novelwriter.enum import nwItemClass +from novelwriter.tools.projwizard import ( GuiProjectWizard, ProjWizardIntroPage, ProjWizardFolderPage, ProjWizardPopulatePage, ProjWizardCustomPage, ProjWizardFinalPage ) diff --git a/tests/test_tools/test_tools_writingstats.py b/tests/test_tools/test_tools_writingstats.py index 995bc2fb..d1afae6f 100644 --- a/tests/test_tools/test_tools_writingstats.py +++ b/tests/test_tools/test_tools_writingstats.py @@ -29,8 +29,8 @@ from mock import causeOSError from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QAction, QFileDialog, QMessageBox -from nw.tools import GuiWritingStats -from nw.constants import nwFiles +from novelwriter.tools import GuiWritingStats +from novelwriter.constants import nwFiles keyDelay = 2 typeDelay = 1