diff options
author | nilshah98 | 2019-03-31 04:28:27 +0530 |
---|---|---|
committer | nilshah98 | 2019-03-31 04:28:27 +0530 |
commit | 30c607ef581345958f0f9bdb5dd5603a1dd774c8 (patch) | |
tree | 106bc0624d2f0900a57e99cc125ac5df6e01db20 /src/ngspicetoModelica | |
parent | 8b986efb1c9216e284f6cc27a8f44d09e5c5cc59 (diff) | |
download | eSim-30c607ef581345958f0f9bdb5dd5603a1dd774c8.tar.gz eSim-30c607ef581345958f0f9bdb5dd5603a1dd774c8.tar.bz2 eSim-30c607ef581345958f0f9bdb5dd5603a1dd774c8.zip |
port to python3
Diffstat (limited to 'src/ngspicetoModelica')
-rw-r--r-- | src/ngspicetoModelica/ModelicaUI.py | 2 | ||||
-rw-r--r-- | src/ngspicetoModelica/NgspicetoModelica.py | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/ngspicetoModelica/ModelicaUI.py b/src/ngspicetoModelica/ModelicaUI.py index e4079562..8b4c33f0 100644 --- a/src/ngspicetoModelica/ModelicaUI.py +++ b/src/ngspicetoModelica/ModelicaUI.py @@ -78,7 +78,7 @@ class OpenModelicaEditor(QtGui.QWidget): self.cmd2 = "OMEdit " + self.modelicaNetlist self.obj_workThread2 = Worker.WorkerThread(self.cmd2) self.obj_workThread2.start() - print "OMEdit called" + print("OMEdit called") self.obj_appconfig.print_info("OMEdit called") else: diff --git a/src/ngspicetoModelica/NgspicetoModelica.py b/src/ngspicetoModelica/NgspicetoModelica.py index 7b7e4527..fcc33b83 100644 --- a/src/ngspicetoModelica/NgspicetoModelica.py +++ b/src/ngspicetoModelica/NgspicetoModelica.py @@ -33,10 +33,10 @@ class NgMoConverter: f = open(filename) except Exception as e: print("Error in opening file") - print(str(e)) + print((str(e))) sys.exit() else: - print filename + " does not exist" + print(filename + " does not exist") sys.exit() data = f.read() @@ -144,7 +144,7 @@ class NgMoConverter: print("Error in opening file") sys.exit() else: - print filename + " does not exist" + print(filename + " does not exist") sys.exit() data = f.read() data = data.replace('+', '').replace('\n','').replace(' = ','=').replace('= ','=').replace(' =','=') @@ -352,7 +352,7 @@ class NgMoConverter: deviceName = eachline[0].lower() if deviceName=='d': if len(words)>3: - if modelInfo[words[3]].has_key('n'): + if 'n' in modelInfo[words[3]]: n = float(modelInfo[words[3]]['n']) else: n = 1.0 @@ -395,7 +395,7 @@ class NgMoConverter: elif trans == 'pnp': start = self.mappingData["Devices"][deviceName]["import"]+".PNP" else: - print "Transistor "+str(trans)+" Not found" + print("Transistor "+str(trans)+" Not found") sys.exit(1) stat = start+" "+words[0]+"(" @@ -446,7 +446,7 @@ class NgMoConverter: elif trans=='pmos' : start = self.mappingData["Devices"][deviceName]["import"]+".Mp" else: - print "MOSFET "+str(trans)+" not found" + print("MOSFET "+str(trans)+" not found") sys.exit(1) @@ -467,7 +467,7 @@ class NgMoConverter: tempstatList.append(actualModelicaParam+"="+self.getUnitVal(modelInfo[refName][key])+" ") userDeviceParamList.append(str(actualModelicaParam)) except Exception as err: - print str(err) + print(str(err)) #Running loop over default parameter of OpenModelica for default in self.mappingData["Devices"][deviceName]["default"]: @@ -991,8 +991,8 @@ def main(args): filename = sys.argv[1] map_json = sys.argv[2] else: - print "USAGE:" - print "python NgspicetoModelica.py <filename>" + print("USAGE:") + print("python NgspicetoModelica.py <filename>") sys.exit() dir_name = os.path.dirname(os.path.realpath(filename)) |