diff options
author | rahulp13 | 2022-02-22 01:07:20 +0530 |
---|---|---|
committer | rahulp13 | 2022-02-22 01:07:20 +0530 |
commit | 1b42df112e9d13afd092d9f415e7e446a2102e85 (patch) | |
tree | 10caef51545fbbf7ee8ab43f02bc1a2650090c30 /src/configuration | |
parent | faadcb72916d269aeabbaa23f799962b6b99c45c (diff) | |
download | eSim-1b42df112e9d13afd092d9f415e7e446a2102e85.tar.gz eSim-1b42df112e9d13afd092d9f415e7e446a2102e85.tar.bz2 eSim-1b42df112e9d13afd092d9f415e7e446a2102e85.zip |
Restructured config paths and other path issues
Diffstat (limited to 'src/configuration')
-rw-r--r-- | src/configuration/Appconfig.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/configuration/Appconfig.py b/src/configuration/Appconfig.py index 21fd717e..e41fc218 100644 --- a/src/configuration/Appconfig.py +++ b/src/configuration/Appconfig.py @@ -34,9 +34,14 @@ class Appconfig(QtWidgets.QWidget): """ # Home directory + if os.name == 'nt': + user_home = os.path.join('library', 'config') + else: + user_home = os.path.expanduser('~') + try: file = open(os.path.join( - os.path.expanduser("~"), ".esim/workspace.txt"), 'r' + user_home, ".esim/workspace.txt"), 'r' ) workspace_check, home = file.readline().split(' ', 1) file.close() @@ -65,11 +70,8 @@ class Appconfig(QtWidgets.QWidget): parser_esim = ConfigParser() parser_esim.read( - os.path.join( - os.path.expanduser("~"), - os.path.join( - '.esim', - 'config.ini'))) + os.path.join(user_home, '.esim', 'config.ini') + ) # Try catch added, since eSim cannot be accessed under parser for Win10 try: |