mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-21 05:12:27 +12:00
Single source the package version
Define one place to store the Manuskript version so that it can be used in multiple locations. Reference: Single-sourcing the package version https://packaging.python.org/guides/single-sourcing-package-version/
This commit is contained in:
parent
e971d7e167
commit
5d462d6a47
|
@ -9,8 +9,7 @@ from PyQt5.QtGui import QIcon
|
||||||
from PyQt5.QtWidgets import QApplication, qApp
|
from PyQt5.QtWidgets import QApplication, qApp
|
||||||
|
|
||||||
from manuskript.functions import appPath, writablePath
|
from manuskript.functions import appPath, writablePath
|
||||||
|
from manuskript.version import getVersion
|
||||||
_version = "0.4.0"
|
|
||||||
|
|
||||||
faulthandler.enable()
|
faulthandler.enable()
|
||||||
|
|
||||||
|
@ -20,9 +19,9 @@ def run():
|
||||||
app.setOrganizationName("manuskript")
|
app.setOrganizationName("manuskript")
|
||||||
app.setOrganizationDomain("www.theologeek.ch")
|
app.setOrganizationDomain("www.theologeek.ch")
|
||||||
app.setApplicationName("manuskript")
|
app.setApplicationName("manuskript")
|
||||||
app.setApplicationVersion(_version)
|
app.setApplicationVersion(getVersion())
|
||||||
|
|
||||||
print("Running manuskript version {}.".format(_version))
|
print("Running manuskript version {}.".format(getVersion()))
|
||||||
icon = QIcon()
|
icon = QIcon()
|
||||||
for i in [16, 32, 64, 128, 256, 512]:
|
for i in [16, 32, 64, 128, 256, 512]:
|
||||||
icon.addFile(appPath("icons/Manuskript/icon-{}px.png".format(i)))
|
icon.addFile(appPath("icons/Manuskript/icon-{}px.png".format(i)))
|
||||||
|
|
9
manuskript/version.py
Normal file
9
manuskript/version.py
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# --!-- coding: utf8 --!--
|
||||||
|
|
||||||
|
# Single source the package version
|
||||||
|
# https://packaging.python.org/guides/single-sourcing-package-version/
|
||||||
|
|
||||||
|
__version__ = "0.4.0"
|
||||||
|
|
||||||
|
def getVersion():
|
||||||
|
return __version__
|
Loading…
Reference in a new issue