make version accessible without having to read a file
This works when krowlog is bundled into a single executable
This commit is contained in:
@@ -4,11 +4,12 @@ import PySide6
|
||||
import urllib3
|
||||
from watchdog import version as watchdog_version
|
||||
from PySide6.QtCore import Qt
|
||||
from PySide6.QtGui import QFont, QPixmap
|
||||
from PySide6.QtGui import QFont
|
||||
from PySide6.QtWidgets import *
|
||||
|
||||
from pathlib import Path
|
||||
import constants
|
||||
|
||||
import krowlog
|
||||
from src.ui.icon import Icon
|
||||
from src.ui.label import Label
|
||||
from src.ui.vbox import VBox
|
||||
@@ -30,7 +31,7 @@ class AboutDialog(QDialog):
|
||||
heading_app_name.setFont(QFont("default", 25))
|
||||
# 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)
|
||||
|
||||
app_icon = QLabel()
|
||||
@@ -85,6 +86,3 @@ class AboutDialog(QDialog):
|
||||
result.layout = QVBoxLayout(result)
|
||||
result.layout.addWidget(Label(label))
|
||||
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