diff options
author | Tanay Mathur | 2015-06-23 11:50:52 +0530 |
---|---|---|
committer | Tanay Mathur | 2015-06-23 11:50:52 +0530 |
commit | 39fecda9f1be8b1007552437d53c06bdc02f4b47 (patch) | |
tree | 3f4bffd09e28240509a215a4b00b3f8b4dda712a /src/projManagement/Validation.py | |
parent | f47a744451fe634efb487023f073321ceed4664c (diff) | |
download | eSim-39fecda9f1be8b1007552437d53c06bdc02f4b47.tar.gz eSim-39fecda9f1be8b1007552437d53c06bdc02f4b47.tar.bz2 eSim-39fecda9f1be8b1007552437d53c06bdc02f4b47.zip |
Added subcircuit functionality
Diffstat (limited to 'src/projManagement/Validation.py')
-rw-r--r-- | src/projManagement/Validation.py | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/src/projManagement/Validation.py b/src/projManagement/Validation.py index a3d84979..ac0473af 100644 --- a/src/projManagement/Validation.py +++ b/src/projManagement/Validation.py @@ -83,7 +83,31 @@ class Validation: else: return False - - - -
\ No newline at end of file + def validateSub(self,subDir,givenNum): + """ + This function checks if ".sub" file is present. + """ + subName = os.path.basename(str(subDir)) + lookSub = os.path.join(str(subDir),subName+".sub") + #Check existence of project + if os.path.exists(lookSub): + f = open(lookSub) + data=f.read() + f.close() + netlist=data.splitlines() + for eachline in netlist: + eachline=eachline.strip() + if len(eachline)<1: + continue + words=eachline.split() + if words[0] == '.subckt': + #The number of ports is specified in this line + #eg. '.subckt ua741 6 7 3' has 3 ports (6, 7 and 3). + numPorts = len(words) - 2 + print "Looksub",lookSub,givenNum,numPorts + if numPorts != givenNum: + return "PORT" + else: + return "True" + else: + return "DIREC"
\ No newline at end of file |