FIXED: configuration file in Windows OS

This commit is contained in:
Wiktor Mazur
2019-09-24 22:07:58 +02:00
parent fbf2228263
commit 418969e6c2
2 changed files with 14 additions and 4 deletions
+9 -1
View File
@@ -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
View File
@@ -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']