make version accessible without having to read a file
This works when krowlog is bundled into a single executable
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
0.1.0
|
|
||||||
@@ -1,18 +1,16 @@
|
|||||||
import logging
|
import logging
|
||||||
import signal
|
import signal
|
||||||
|
|
||||||
from PySide6 import QtCore
|
from PySide6 import QtCore
|
||||||
from PySide6.QtWidgets import QApplication
|
from PySide6.QtWidgets import QApplication
|
||||||
from PySide6.QtCore import QTimer
|
from PySide6.QtCore import QTimer
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import constants
|
import constants
|
||||||
from src.pluginregistry import PluginRegistry
|
from src.pluginregistry import PluginRegistry
|
||||||
|
|
||||||
import gettext
|
import gettext
|
||||||
|
|
||||||
from src.ui.icon import Icon
|
from src.ui.icon import Icon
|
||||||
|
|
||||||
|
__version__ = '0.2.0'
|
||||||
|
|
||||||
gettext.install('krowlog', 'locale')
|
gettext.install('krowlog', 'locale')
|
||||||
|
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
@@ -4,11 +4,12 @@ import PySide6
|
|||||||
import urllib3
|
import urllib3
|
||||||
from watchdog import version as watchdog_version
|
from watchdog import version as watchdog_version
|
||||||
from PySide6.QtCore import Qt
|
from PySide6.QtCore import Qt
|
||||||
from PySide6.QtGui import QFont, QPixmap
|
from PySide6.QtGui import QFont
|
||||||
from PySide6.QtWidgets import *
|
from PySide6.QtWidgets import *
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
import constants
|
import constants
|
||||||
|
|
||||||
|
import krowlog
|
||||||
from src.ui.icon import Icon
|
from src.ui.icon import Icon
|
||||||
from src.ui.label import Label
|
from src.ui.label import Label
|
||||||
from src.ui.vbox import VBox
|
from src.ui.vbox import VBox
|
||||||
@@ -30,7 +31,7 @@ class AboutDialog(QDialog):
|
|||||||
heading_app_name.setFont(QFont("default", 25))
|
heading_app_name.setFont(QFont("default", 25))
|
||||||
# heading_app_name.setTextInteractionFlags(Qt.TextInteractionFlag.TextSelectableByMouse)
|
# heading_app_name.setTextInteractionFlags(Qt.TextInteractionFlag.TextSelectableByMouse)
|
||||||
|
|
||||||
version = Label(_("Version: {0}").format(self._version()))
|
version = Label(_("Version: {0}").format(krowlog.__version__))
|
||||||
version.setAlignment(Qt.AlignmentFlag.AlignLeft)
|
version.setAlignment(Qt.AlignmentFlag.AlignLeft)
|
||||||
|
|
||||||
app_icon = QLabel()
|
app_icon = QLabel()
|
||||||
@@ -85,6 +86,3 @@ class AboutDialog(QDialog):
|
|||||||
result.layout = QVBoxLayout(result)
|
result.layout = QVBoxLayout(result)
|
||||||
result.layout.addWidget(Label(label))
|
result.layout.addWidget(Label(label))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def _version(self):
|
|
||||||
return Path(__file__).parent.parent.parent.parent.joinpath('VERSION.info').read_text("utf8").strip()
|
|
||||||
|
|||||||
Reference in New Issue
Block a user