mirror of https://gitlab.com/pamhyr/pamhyr2
debug: Display qt5 path in terminal.
parent
8da1cb622f
commit
397b5b0cab
11
src/init.py
11
src/init.py
|
|
@ -20,7 +20,7 @@ import sys, os
|
||||||
import locale
|
import locale
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyQt5.QtCore import QTranslator
|
from PyQt5.QtCore import QTranslator, QLibraryInfo
|
||||||
|
|
||||||
from tools import (
|
from tools import (
|
||||||
reset_timers, display_timers, timer,
|
reset_timers, display_timers, timer,
|
||||||
|
|
@ -57,7 +57,7 @@ except:
|
||||||
logger.error("Failed to create logfile...")
|
logger.error("Failed to create logfile...")
|
||||||
|
|
||||||
|
|
||||||
def license():
|
def legal_info():
|
||||||
"Display in stdout Pamhyr infomation about licence and version"
|
"Display in stdout Pamhyr infomation about licence and version"
|
||||||
blue = lambda s: logger.info(f"{logger_color_blue()}{s}{logger_color_reset()}")
|
blue = lambda s: logger.info(f"{logger_color_blue()}{s}{logger_color_reset()}")
|
||||||
|
|
||||||
|
|
@ -83,10 +83,15 @@ def license():
|
||||||
logger.info("license: This is free software, and you are welcome to redistribute it")
|
logger.info("license: This is free software, and you are welcome to redistribute it")
|
||||||
logger.info("license: under certain conditions.")
|
logger.info("license: under certain conditions.")
|
||||||
|
|
||||||
py_version = sys.version.split("\n")[0]
|
|
||||||
|
|
||||||
|
def debug_info():
|
||||||
|
py_version = sys.version.split("\n")[0]
|
||||||
logger.info(f"python: {py_version}")
|
logger.info(f"python: {py_version}")
|
||||||
|
|
||||||
|
info = QLibraryInfo
|
||||||
|
logger.info(f"{info.location(QLibraryInfo.PrefixPath)}")
|
||||||
|
logger.info(f"{info.location(QLibraryInfo.LibraryExecutablesPath)}")
|
||||||
|
|
||||||
def setup_lang(app, conf:Config):
|
def setup_lang(app, conf:Config):
|
||||||
"Return QTranslator configured for current language"
|
"Return QTranslator configured for current language"
|
||||||
lang_file = ""
|
lang_file = ""
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ from Model.Study import Study
|
||||||
from Scripts.P3DST import Script3DST
|
from Scripts.P3DST import Script3DST
|
||||||
from Scripts.Hello import ScriptHello
|
from Scripts.Hello import ScriptHello
|
||||||
|
|
||||||
from init import license, setup_lang
|
from init import legal_info, debug_info, setup_lang
|
||||||
|
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
|
|
||||||
|
|
@ -71,7 +71,8 @@ def main():
|
||||||
tr = setup_lang(app, conf)
|
tr = setup_lang(app, conf)
|
||||||
app.installTranslator(tr)
|
app.installTranslator(tr)
|
||||||
|
|
||||||
license()
|
legal_info()
|
||||||
|
debug_info()
|
||||||
|
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
# Run a script
|
# Run a script
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue