FIXED: configuration file in Windows OS
This commit is contained in:
+9
-1
@@ -15,10 +15,18 @@ opacity = 0.5
|
||||
version = '%s'
|
||||
""" % (CFG_VERSION)
|
||||
|
||||
_script_path = None
|
||||
|
||||
|
||||
def set_script_path(path):
|
||||
global _script_path
|
||||
_script_path = path
|
||||
|
||||
|
||||
def config():
|
||||
global _script_path
|
||||
conf_file = os.path.join(os.path.dirname(
|
||||
os.path.realpath(__file__)), 'albion-online-stats.cfg')
|
||||
_script_path), 'albion-online-stats.cfg')
|
||||
|
||||
try:
|
||||
with open(conf_file, "r") as cfg_file:
|
||||
|
||||
+4
-2
@@ -5,15 +5,17 @@ from PySide2.QtWidgets import QApplication
|
||||
|
||||
import libmeter
|
||||
|
||||
from config import set_script_path
|
||||
set_script_path(sys.argv[0]) # pyinstaller creates tmpdir for python files, thus this is the way to get executable path
|
||||
|
||||
from config import config
|
||||
from main import MainWidget
|
||||
from engine import initialize
|
||||
from styling import style
|
||||
from config import config
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
initialize()
|
||||
|
||||
conf = config()
|
||||
window_config = conf['window']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user