summaryrefslogtreecommitdiff
path: root/src/ngspicetoModelica
diff options
context:
space:
mode:
authorfahim-oscad2016-04-28 15:08:08 +0530
committerfahim-oscad2016-04-28 15:08:08 +0530
commit458d27e3fa3f8864eb2b47e2b39ca74a6f5e035f (patch)
treec3e24a32b89898024b4219bf61bd2aa4a2236cb4 /src/ngspicetoModelica
parent11ac9b3874e4e84576c3b735c8ecbfd6583648bc (diff)
downloadeSim-458d27e3fa3f8864eb2b47e2b39ca74a6f5e035f.tar.gz
eSim-458d27e3fa3f8864eb2b47e2b39ca74a6f5e035f.tar.bz2
eSim-458d27e3fa3f8864eb2b47e2b39ca74a6f5e035f.zip
Generated Subcircuit .mo file properly when the folder contains '.' in path
Diffstat (limited to 'src/ngspicetoModelica')
-rw-r--r--src/ngspicetoModelica/NgspicetoModelica.py7
1 files 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()