Rename package from 'nw' to 'novelwriter' (#868)
* Rename nw folder to novelwriter * Rename nw to novelwriter in auxiliary files * Rename nw to novelwriter in main app source * Rename nw to novelwriter in tests * Make setup script for pdf docs less spammy
This commit is contained in:
1 parent
2cf2eb9f55
commit
3403d98c72
396 files changed
+595
-566
No files matched your search
@@ -23,9 +23,9 @@ jobs:
|
|||||||
run: pip install flake8
|
run: pip install flake8
|
||||||
- name: Syntax Error Check
|
- name: Syntax Error Check
|
||||||
run: |
|
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
|
flake8 tests --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||||
- name: Coding Style Violations
|
- name: Coding Style Violations
|
||||||
run: |
|
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
|
flake8 tests --count --max-line-length=99 --ignore E221,E226,E228,E241 --show-source --statistics
|
||||||
@@ -36,6 +36,6 @@ jobs:
|
|||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: |
|
run: |
|
||||||
export QT_QPA_PLATFORM=offscreen
|
export QT_QPA_PLATFORM=offscreen
|
||||||
pytest -v --cov=nw --timeout=60
|
pytest -v --cov=novelwriter --timeout=60
|
||||||
- name: Upload to Codecov
|
- name: Upload to Codecov
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
@@ -31,6 +31,6 @@ jobs:
|
|||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: |
|
run: |
|
||||||
export QT_QPA_PLATFORM=offscreen
|
export QT_QPA_PLATFORM=offscreen
|
||||||
pytest -v --cov=nw --timeout=60
|
pytest -v --cov=novelwriter --timeout=60
|
||||||
- name: Upload to Codecov
|
- name: Upload to Codecov
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
@@ -26,6 +26,6 @@ jobs:
|
|||||||
pip install -r requirements-dev.txt
|
pip install -r requirements-dev.txt
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: |
|
run: |
|
||||||
pytest -v --cov=nw --timeout=60
|
pytest -v --cov=novelwriter --timeout=60
|
||||||
- name: Upload to Codecov
|
- name: Upload to Codecov
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
+4
-4
@@ -10,15 +10,15 @@ novelwriter.desktop
|
|||||||
novelWriter.pyw
|
novelWriter.pyw
|
||||||
|
|
||||||
# Translations
|
# Translations
|
||||||
/nw/assets/i18n/*.qm
|
/novelwriter/assets/i18n/*.qm
|
||||||
.qmake.stash
|
.qmake.stash
|
||||||
i18n/*.qm
|
i18n/*.qm
|
||||||
i18n/*.qph
|
i18n/*.qph
|
||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
/docs/build/
|
/docs/build/
|
||||||
/nw/assets/help/html/
|
/novelwriter/assets/help/html/
|
||||||
/nw/assets/help/manual.pdf
|
/novelwriter/assets/help/manual.pdf
|
||||||
/UserManual.pdf
|
/UserManual.pdf
|
||||||
*.qch
|
*.qch
|
||||||
*.qhc
|
*.qhc
|
||||||
@@ -28,7 +28,7 @@ __pycache__
|
|||||||
*.pyc
|
*.pyc
|
||||||
|
|
||||||
# Sample Project
|
# Sample Project
|
||||||
/nw/assets/sample.zip
|
/novelwriter/assets/sample.zip
|
||||||
/sample/cache
|
/sample/cache
|
||||||
/sample/meta
|
/sample/meta
|
||||||
/sample/versions
|
/sample/versions
|
||||||
|
|||||||
+1
-1
@@ -2,5 +2,5 @@ include setup.py
|
|||||||
include LICENSE.md
|
include LICENSE.md
|
||||||
include CHANGELOG.md
|
include CHANGELOG.md
|
||||||
recursive-include setup *
|
recursive-include setup *
|
||||||
recursive-include nw/assets *
|
recursive-include novelwriter/assets *
|
||||||
recursive-include sample *.nwx *.nwd
|
recursive-include sample *.nwx *.nwd
|
||||||
@@ -112,8 +112,8 @@ Building the Translation Files
|
|||||||
|
|
||||||
If you installed novelWriter from a package, the translation files should be pre-built and
|
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
|
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
|
yourself. The files you need will be written to the ``novelwriter/assets/i18n`` folder, and will
|
||||||
``.qm`` file extension.
|
have the ``.qm`` file extension.
|
||||||
|
|
||||||
You can build the ``.qm`` files with:
|
You can build the ``.qm`` files with:
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ You can also add coverage report generation. For instance to HTML:
|
|||||||
|
|
||||||
.. code-block:: console
|
.. 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.
|
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
|
.. 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
|
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
|
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
|
.. 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.
|
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".
|
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
|
.. 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.
|
To run a single test, simply add the full test name to the ``-k`` switch.
|
||||||
+5
-5
@@ -3,8 +3,8 @@
|
|||||||
The `i18n` folder contains the translation files for the Qt5 GUI. There are two types of files
|
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`
|
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
|
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,
|
are located in `novelwriter/assets/i18n`. The latter are JSON translation maps for the novelWriter
|
||||||
used by the Build Novel Project tool.
|
projects, used by the Build Novel Project tool.
|
||||||
|
|
||||||
**Note**
|
**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
|
editing the `.ts` file. Please select "English" and "United Kingdom" as the source langauge when
|
||||||
prompted by Qt 5 Linguist.
|
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
|
novelWriter. The Preferences dialog should list the newly added language, and you can select it and
|
||||||
test it.
|
test it.
|
||||||
|
|
||||||
@@ -71,8 +71,8 @@ files.
|
|||||||
## Project Localisation
|
## Project Localisation
|
||||||
|
|
||||||
Projects can have a different language setting than the GUI itself. The files with format
|
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
|
`project_XX.json` in `novelwriter/assets/i18n` are simple translation maps for text that goes into
|
||||||
exported documents generated by the Build Novel Project tool.
|
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
|
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
|
parts of the application use these files. Since these are used as replacement lookups, they are
|
||||||
|
|||||||
+29
-29
@@ -1,34 +1,34 @@
|
|||||||
SOURCES += \
|
SOURCES += \
|
||||||
i18n/qtbase.py \
|
i18n/qtbase.py \
|
||||||
nw/core/project.py \
|
novelwriter/core/project.py \
|
||||||
nw/core/tokenizer.py \
|
novelwriter/core/tokenizer.py \
|
||||||
nw/dialogs/about.py \
|
novelwriter/dialogs/about.py \
|
||||||
nw/dialogs/docmerge.py \
|
novelwriter/dialogs/docmerge.py \
|
||||||
nw/dialogs/docsplit.py \
|
novelwriter/dialogs/docsplit.py \
|
||||||
nw/dialogs/itemeditor.py \
|
novelwriter/dialogs/itemeditor.py \
|
||||||
nw/dialogs/preferences.py \
|
novelwriter/dialogs/preferences.py \
|
||||||
nw/dialogs/projload.py \
|
novelwriter/dialogs/projload.py \
|
||||||
nw/dialogs/projsettings.py \
|
novelwriter/dialogs/projsettings.py \
|
||||||
nw/dialogs/wordlist.py \
|
novelwriter/dialogs/wordlist.py \
|
||||||
nw/gui/custom.py \
|
novelwriter/gui/custom.py \
|
||||||
nw/gui/doceditor.py \
|
novelwriter/gui/doceditor.py \
|
||||||
nw/gui/docviewer.py \
|
novelwriter/gui/docviewer.py \
|
||||||
nw/gui/itemdetails.py \
|
novelwriter/gui/itemdetails.py \
|
||||||
nw/gui/mainmenu.py \
|
novelwriter/gui/mainmenu.py \
|
||||||
nw/gui/noveltree.py \
|
novelwriter/gui/noveltree.py \
|
||||||
nw/gui/outline.py \
|
novelwriter/gui/outline.py \
|
||||||
nw/gui/outlinedetails.py \
|
novelwriter/gui/outlinedetails.py \
|
||||||
nw/gui/projdetails.py \
|
novelwriter/gui/projdetails.py \
|
||||||
nw/gui/projtree.py \
|
novelwriter/gui/projtree.py \
|
||||||
nw/gui/statusbar.py \
|
novelwriter/gui/statusbar.py \
|
||||||
nw/gui/theme.py \
|
novelwriter/gui/theme.py \
|
||||||
nw/tools/build.py \
|
novelwriter/tools/build.py \
|
||||||
nw/tools/projwizard.py \
|
novelwriter/tools/projwizard.py \
|
||||||
nw/tools/writingstats.py \
|
novelwriter/tools/writingstats.py \
|
||||||
nw/common.py \
|
novelwriter/common.py \
|
||||||
nw/constants.py \
|
novelwriter/constants.py \
|
||||||
nw/error.py \
|
novelwriter/error.py \
|
||||||
nw/guimain.py
|
novelwriter/guimain.py
|
||||||
|
|
||||||
TRANSLATIONS += \
|
TRANSLATIONS += \
|
||||||
i18n/nw_en_US.ts \
|
i18n/nw_en_US.ts \
|
||||||
|
|||||||
+2
-2
@@ -17,5 +17,5 @@ except Exception:
|
|||||||
os.curdir = os.path.abspath(os.path.dirname(__file__))
|
os.curdir = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import nw
|
import novelwriter
|
||||||
nw.main(sys.argv[1:])
|
novelwriter.main(sys.argv[1:])
|
||||||
@@ -30,8 +30,8 @@ import logging
|
|||||||
from PyQt5.QtGui import QIcon
|
from PyQt5.QtGui import QIcon
|
||||||
from PyQt5.QtWidgets import QApplication, QErrorMessage
|
from PyQt5.QtWidgets import QApplication, QErrorMessage
|
||||||
|
|
||||||
from nw.error import exceptionHandler, logException
|
from novelwriter.error import exceptionHandler, logException
|
||||||
from nw.config import Config
|
from novelwriter.config import Config
|
||||||
|
|
||||||
##
|
##
|
||||||
# Version Scheme
|
# Version Scheme
|
||||||
@@ -55,7 +55,7 @@ from nw.config import Config
|
|||||||
# 0x010201f0 : 1.2.1 1.2.1 Patch release
|
# 0x010201f0 : 1.2.1 1.2.1 Patch release
|
||||||
##
|
##
|
||||||
|
|
||||||
__package__ = "nw"
|
__package__ = "novelwriter"
|
||||||
__copyright__ = "Copyright 2018–2021, Veronica Berglyd Olsen"
|
__copyright__ = "Copyright 2018–2021, Veronica Berglyd Olsen"
|
||||||
__license__ = "GPLv3"
|
__license__ = "GPLv3"
|
||||||
__author__ = "Veronica Berglyd Olsen"
|
__author__ = "Veronica Berglyd Olsen"
|
||||||
@@ -185,10 +185,10 @@ def main(sysArgs=None):
|
|||||||
logLevel = logging.INFO
|
logLevel = logging.INFO
|
||||||
elif inOpt == "--debug":
|
elif inOpt == "--debug":
|
||||||
logLevel = logging.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":
|
elif inOpt == "--verbose":
|
||||||
logLevel = VERBOSE
|
logLevel = VERBOSE
|
||||||
logFormat = "[{asctime:}] {name:>22}:{lineno:<4d} {levelname:8} {message:}"
|
logFormat = "[{asctime:}] {filename:>17}:{lineno:<4d} {levelname:8} {message:}"
|
||||||
elif inOpt == "--style":
|
elif inOpt == "--style":
|
||||||
qtStyle = inArg
|
qtStyle = inArg
|
||||||
elif inOpt == "--config":
|
elif inOpt == "--config":
|
||||||
@@ -276,7 +276,7 @@ def main(sysArgs=None):
|
|||||||
logException()
|
logException()
|
||||||
|
|
||||||
# Import GUI (after dependency checks), and launch
|
# Import GUI (after dependency checks), and launch
|
||||||
from nw.guimain import GuiMain
|
from novelwriter.guimain import GuiMain
|
||||||
if testMode:
|
if testMode:
|
||||||
nwGUI = GuiMain()
|
nwGUI = GuiMain()
|
||||||
return nwGUI
|
return nwGUI
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 396 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user