diff options
author | rahulp13 | 2022-02-20 22:47:34 +0530 |
---|---|---|
committer | rahulp13 | 2022-02-20 23:26:18 +0530 |
commit | d4386f27a746d8508a1e4770441011183b128149 (patch) | |
tree | deae81b2cd25dd2fdcff454716bf3ace1d9007bf | |
parent | 0bff42171c4f77c199309906300efe99c67101c4 (diff) | |
download | nghdl-d4386f27a746d8508a1e4770441011183b128149.tar.gz nghdl-d4386f27a746d8508a1e4770441011183b128149.tar.bz2 nghdl-d4386f27a746d8508a1e4770441011183b128149.zip |
Resolves HOME path issue on Windows OS
-rwxr-xr-x | src/Appconfig.py | 6 | ||||
-rwxr-xr-x | src/model_generation.py | 7 | ||||
-rwxr-xr-x | src/ngspice_ghdl.py | 6 |
3 files changed, 16 insertions, 3 deletions
diff --git a/src/Appconfig.py b/src/Appconfig.py index 9789d2c..d03dcc3 100755 --- a/src/Appconfig.py +++ b/src/Appconfig.py @@ -3,7 +3,11 @@ from configparser import ConfigParser class Appconfig: - home = os.path.expanduser("~") + if os.name == 'nt': + home = os.path.join('library', 'config') + else: + home = os.path.expanduser('~') + # Reading all variables from eSim config.ini parser_esim = ConfigParser() parser_esim.read(os.path.join(home, os.path.join('.esim', 'config.ini'))) diff --git a/src/model_generation.py b/src/model_generation.py index 5e8684e..7342eef 100755 --- a/src/model_generation.py +++ b/src/model_generation.py @@ -11,7 +11,12 @@ class ModelGeneration: print("Arguement is : ", file) self.fname = os.path.basename(file) print("VHDL filename is : ", self.fname) - self.home = os.path.expanduser("~") + + if os.name == 'nt': + self.home = os.path.join('library', 'config') + else: + self.home = os.path.expanduser('~') + self.parser = ConfigParser() self.parser.read(os.path.join( self.home, os.path.join('.nghdl', 'config.ini'))) diff --git a/src/ngspice_ghdl.py b/src/ngspice_ghdl.py index 329329f..97f1d06 100755 --- a/src/ngspice_ghdl.py +++ b/src/ngspice_ghdl.py @@ -20,7 +20,11 @@ class Mainwindow(QtWidgets.QWidget): QtWidgets.QMainWindow.__init__(self) print("Initializing..........") - self.home = os.path.expanduser("~") + if os.name == 'nt': + self.home = os.path.join('library', 'config') + else: + self.home = os.path.expanduser('~') + # Reading all variables from config.ini self.parser = ConfigParser() self.parser.read( |