Merge branch 'testing' into dev
This commit is contained in:
@@ -26,8 +26,12 @@ jobs:
|
|||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install pytest-timeout
|
pip install pytest-timeout
|
||||||
|
pip install pytest-cov
|
||||||
pip install pytest-qt
|
pip install pytest-qt
|
||||||
|
pip install codecov
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: |
|
run: |
|
||||||
export QT_QPA_PLATFORM=offscreen
|
export QT_QPA_PLATFORM=offscreen
|
||||||
pytest -v --timeout=60
|
pytest -v --cov=nw --timeout=60
|
||||||
|
- name: Upload to Codecov
|
||||||
|
uses: codecov/codecov-action@v1
|
||||||
|
|||||||
@@ -26,8 +26,12 @@ jobs:
|
|||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install pytest-timeout
|
pip install pytest-timeout
|
||||||
|
pip install pytest-cov
|
||||||
pip install pytest-qt
|
pip install pytest-qt
|
||||||
|
pip install codecov
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: |
|
run: |
|
||||||
export QT_QPA_PLATFORM=offscreen
|
export QT_QPA_PLATFORM=offscreen
|
||||||
pytest -v --timeout=60
|
pytest -v --cov=nw --timeout=60
|
||||||
|
- name: Upload to Codecov
|
||||||
|
uses: codecov/codecov-action@v1
|
||||||
|
|||||||
@@ -133,13 +133,14 @@ you're running novelWriter from the source code, a local copy of this documentat
|
|||||||
generated. It requires the following Python packages on Debian and Ubuntu.
|
generated. It requires the following Python packages on Debian and Ubuntu.
|
||||||
|
|
||||||
* ``python3-sphinx``
|
* ``python3-sphinx``
|
||||||
|
* ``python3-sphinx-rtd-theme``
|
||||||
* ``python3-sphinxcontrib.qthelp``
|
* ``python3-sphinxcontrib.qthelp``
|
||||||
|
|
||||||
Or from PyPi:
|
Or from PyPi:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
pip install sphinx sphinxcontrib-qthelp
|
pip install sphinx sphinx-rtd-theme sphinxcontrib-qthelp
|
||||||
|
|
||||||
The documentation can then be built from the ``docs`` folder in the source code by running:
|
The documentation can then be built from the ``docs`` folder in the source code by running:
|
||||||
|
|
||||||
|
|||||||
@@ -95,3 +95,16 @@ all users, run the script with the ``sudo`` command.
|
|||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
All options of the setup script can be listed with: ``./setup.py help``.
|
All options of the setup script can be listed with: ``./setup.py help``.
|
||||||
|
|
||||||
|
|
||||||
|
Uninstalling Icons
|
||||||
|
==================
|
||||||
|
|
||||||
|
The steps taken by the ``xdg-install`` step can be reversed by running:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
./setup.py xdg-uninstall
|
||||||
|
|
||||||
|
This will remove the desktop launcher and icons from the system. As above, whether this is done on
|
||||||
|
the current user, or system wide, depends on whether this command is called with ``sudo`` or not.
|
||||||
|
|||||||
+792
-791
File diff suppressed because it is too large
Load Diff
+792
-791
File diff suppressed because it is too large
Load Diff
+790
-790
File diff suppressed because it is too large
Load Diff
+803
-802
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,5 @@
|
|||||||
SOURCES += \
|
SOURCES += \
|
||||||
i18n/dummy_qtbase.py \
|
i18n/dummy_qtbase.py \
|
||||||
nw/constants/constants.py \
|
|
||||||
nw/core/document.py \
|
nw/core/document.py \
|
||||||
nw/core/project.py \
|
nw/core/project.py \
|
||||||
nw/core/tokenizer.py \
|
nw/core/tokenizer.py \
|
||||||
@@ -28,6 +27,7 @@ SOURCES += \
|
|||||||
nw/gui/wordlist.py \
|
nw/gui/wordlist.py \
|
||||||
nw/gui/writingstats.py \
|
nw/gui/writingstats.py \
|
||||||
nw/common.py \
|
nw/common.py \
|
||||||
|
nw/constants.py \
|
||||||
nw/error.py \
|
nw/error.py \
|
||||||
nw/guimain.py
|
nw/guimain.py
|
||||||
|
|
||||||
|
|||||||
@@ -620,14 +620,6 @@ def xdgInstall():
|
|||||||
else:
|
else:
|
||||||
print(f"Error {exCode}: Could not install menu desktop file")
|
print(f"Error {exCode}: Could not install menu desktop file")
|
||||||
|
|
||||||
exCode = subprocess.call(
|
|
||||||
["xdg-desktop-icon", "install", "--novendor", "./novelwriter.desktop"]
|
|
||||||
)
|
|
||||||
if exCode == 0:
|
|
||||||
print("Installed icon desktop file")
|
|
||||||
else:
|
|
||||||
print(f"Error {exCode}: Could not install icon desktop file")
|
|
||||||
|
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
# Install MimeType
|
# Install MimeType
|
||||||
@@ -686,6 +678,68 @@ def xdgInstall():
|
|||||||
else:
|
else:
|
||||||
print(f"Error {exCode}: Could not update icon cache")
|
print(f"Error {exCode}: Could not update icon cache")
|
||||||
|
|
||||||
|
# Clean up
|
||||||
|
if os.path.isfile("./novelwriter.desktop"):
|
||||||
|
os.unlink("./novelwriter.desktop")
|
||||||
|
|
||||||
|
print("")
|
||||||
|
print("Done!")
|
||||||
|
print("")
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
##
|
||||||
|
# XDG Uninstallation (xdg-uninstall)
|
||||||
|
##
|
||||||
|
|
||||||
|
def xdgUninstall():
|
||||||
|
"""Will attempt to uninstall icons and make a launcher.
|
||||||
|
"""
|
||||||
|
print("")
|
||||||
|
print("XDG Uninstall")
|
||||||
|
print("=============")
|
||||||
|
print("")
|
||||||
|
|
||||||
|
exCode = subprocess.call(
|
||||||
|
["xdg-desktop-menu", "uninstall", "novelwriter.desktop"]
|
||||||
|
)
|
||||||
|
if exCode == 0:
|
||||||
|
print("Uninstalled menu desktop file")
|
||||||
|
else:
|
||||||
|
print(f"Error {exCode}: Could not uninstall menu desktop file")
|
||||||
|
|
||||||
|
sizeArr = ["16", "22", "24", "32", "48", "64", "96", "128", "256", "512"]
|
||||||
|
|
||||||
|
# App Icon
|
||||||
|
for aSize in sizeArr:
|
||||||
|
exCode = subprocess.call([
|
||||||
|
"xdg-icon-resource", "uninstall", "--noupdate",
|
||||||
|
"--context", "apps", "--size", aSize, "novelwriter"
|
||||||
|
])
|
||||||
|
if exCode == 0:
|
||||||
|
print(f"Uninstalled app icon size {aSize}")
|
||||||
|
else:
|
||||||
|
print(f"Error {exCode}: Could not uninstall app icon size {aSize}")
|
||||||
|
|
||||||
|
# Mimetype
|
||||||
|
for aSize in sizeArr:
|
||||||
|
exCode = subprocess.call([
|
||||||
|
"xdg-icon-resource", "uninstall", "--noupdate",
|
||||||
|
"--context", "mimetypes", "--size", aSize,
|
||||||
|
"application-x-novelwriter-project"
|
||||||
|
])
|
||||||
|
if exCode == 0:
|
||||||
|
print(f"Uninstalled mime icon size {aSize}")
|
||||||
|
else:
|
||||||
|
print(f"Error {exCode}: Could not uninstall mime icon size {aSize}")
|
||||||
|
|
||||||
|
# Update Cache
|
||||||
|
exCode = subprocess.call(["xdg-icon-resource", "forceupdate"])
|
||||||
|
if exCode == 0:
|
||||||
|
print("Updated icon cache")
|
||||||
|
else:
|
||||||
|
print(f"Error {exCode}: Could not update icon cache")
|
||||||
|
|
||||||
print("")
|
print("")
|
||||||
print("Done!")
|
print("Done!")
|
||||||
print("")
|
print("")
|
||||||
@@ -926,6 +980,7 @@ if __name__ == "__main__":
|
|||||||
" install.\n"
|
" install.\n"
|
||||||
" xdg-install Install launcher and icons for freedesktop systems. Run as root or \n"
|
" xdg-install Install launcher and icons for freedesktop systems. Run as root or \n"
|
||||||
" with sudo for system-wide install, or as user for single user install.\n"
|
" with sudo for system-wide install, or as user for single user install.\n"
|
||||||
|
" Running 'xdg-uninstall' will remove the icons.\n"
|
||||||
" win-install Install desktop and start menu icons for Windows systems.\n"
|
" win-install Install desktop and start menu icons for Windows systems.\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -985,11 +1040,6 @@ if __name__ == "__main__":
|
|||||||
# General Installers
|
# General Installers
|
||||||
# ==================
|
# ==================
|
||||||
|
|
||||||
if "launcher" in sys.argv:
|
|
||||||
sys.argv.remove("launcher")
|
|
||||||
print("The 'launcher' command has been replaced by 'xdg-install'.")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if "xdg-install" in sys.argv:
|
if "xdg-install" in sys.argv:
|
||||||
sys.argv.remove("xdg-install")
|
sys.argv.remove("xdg-install")
|
||||||
if hostOS == OS_WIN:
|
if hostOS == OS_WIN:
|
||||||
@@ -998,6 +1048,14 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
xdgInstall()
|
xdgInstall()
|
||||||
|
|
||||||
|
if "xdg-uninstall" in sys.argv:
|
||||||
|
sys.argv.remove("xdg-uninstall")
|
||||||
|
if hostOS == OS_WIN:
|
||||||
|
print("ERROR: Command 'xdg-uninstall' cannot be used on Windows")
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
xdgUninstall()
|
||||||
|
|
||||||
if "win-install" in sys.argv:
|
if "win-install" in sys.argv:
|
||||||
sys.argv.remove("win-install")
|
sys.argv.remove("win-install")
|
||||||
if hostOS == OS_WIN:
|
if hostOS == OS_WIN:
|
||||||
|
|||||||
@@ -50,5 +50,6 @@ install.
|
|||||||
|
|
||||||
`xdg-install` – Install launcher and icons for freedesktop systems. Run as root
|
`xdg-install` – Install launcher and icons for freedesktop systems. Run as root
|
||||||
or with sudo for system-wide install, or as user for single user install.
|
or with sudo for system-wide install, or as user for single user install.
|
||||||
|
Running `xdg-uninstall` will remove the icons.
|
||||||
|
|
||||||
`win-install` – Install desktop and start menu icons for Windows systems.
|
`win-install` – Install desktop and start menu icons for Windows systems.
|
||||||
|
|||||||
Reference in New Issue
Block a user