From 458d27e3fa3f8864eb2b47e2b39ca74a6f5e035f Mon Sep 17 00:00:00 2001 From: fahim-oscad Date: Thu, 28 Apr 2016 15:08:08 +0530 Subject: Generated Subcircuit .mo file properly when the folder contains '.' in path --- src/ngspicetoModelica/NgspicetoModelica.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ngspicetoModelica/NgspicetoModelica.py b/src/ngspicetoModelica/NgspicetoModelica.py index ad5f703a..058a2442 100644 --- a/src/ngspicetoModelica/NgspicetoModelica.py +++ b/src/ngspicetoModelica/NgspicetoModelica.py @@ -910,11 +910,12 @@ class NgMoConverter: #print "modelicaSubParamNew----------------->",modelicaSubParamNew connSubInfo = self.connectInfo(subSchemInfo, nodeSub, nodeDicSub, numNodesSubsub,subcktName) #print "connSubInfo----------------->",connSubInfo - newname = filename.split('.') + newname = basename.split('.') newfilename = newname[0] outfilename = newfilename+ ".mo" + outfilename = os.path.join(dir_name, outfilename) out = open(outfilename,"w") - out.writelines('model ' + os.path.basename(newfilename)) + out.writelines('model ' + newfilename) out.writelines('\n') if IfMOSsub == '0': out.writelines('import Modelica.Electrical.*;') @@ -949,7 +950,7 @@ class NgMoConverter: else: out.writelines(eachline) out.writelines('\n') - out.writelines('end '+ os.path.basename(newfilename) + ';') + out.writelines('end '+ newfilename + ';') out.writelines('\n') out.close() -- cgit