summaryrefslogtreecommitdiff
path: root/src/projManagement
diff options
context:
space:
mode:
authorSunil Shetye2019-06-28 15:59:38 +0530
committerSunil Shetye2019-07-01 12:12:45 +0530
commit70876a368e69d799bbe431254bd1a4ce7cea090c (patch)
tree095f995d82f204332ba61087a25b1cf77b48feb4 /src/projManagement
parent57d843c500d3a45de95fbac9c2a04c8a3670fb2a (diff)
downloadeSim-70876a368e69d799bbe431254bd1a4ce7cea090c.tar.gz
eSim-70876a368e69d799bbe431254bd1a4ce7cea090c.tar.bz2
eSim-70876a368e69d799bbe431254bd1a4ce7cea090c.zip
directly select filename
Diffstat (limited to 'src/projManagement')
-rw-r--r--src/projManagement/Validation.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/projManagement/Validation.py b/src/projManagement/Validation.py
index f2d84314..451fe831 100644
--- a/src/projManagement/Validation.py
+++ b/src/projManagement/Validation.py
@@ -188,7 +188,7 @@ class Validation:
"""This function check if tool is present in the system."""
return distutils.spawn.find_executable(toolName) is not None
- def validateSubcir(self, projDir):
+ def validateSubcir(self, projDir, fileName):
"""
This function checks for valid format of .sub file.
Correct format of file is:
@@ -203,8 +203,6 @@ class Validation:
return False.
"""
- projName = os.path.basename(str(projDir))
- fileName = projName[:-4]
first = True
last_line = []
@@ -212,7 +210,6 @@ class Validation:
# Checks if file is empty or not.
if os.stat(projDir).st_size == 0:
print("File is empty")
- print("===================")
return False
with open(projDir, 'r') as f:
@@ -224,7 +221,7 @@ class Validation:
if word[0] == ".subckt" and word[1] == fileName:
first = False
else:
- print("First line not found")
+ print("First line not found:", word)
return False
else:
last_line = word
@@ -233,10 +230,9 @@ class Validation:
print("First line not found")
return False
- print(last_line)
if len(last_line) >= 2 and last_line[0] == ".ends" and \
last_line[1] == fileName:
return True
- print("Last line not found")
+ print("Last line not found:", last_line)
return False