summaryrefslogtreecommitdiff
path: root/src/projManagement/Validation.py
diff options
context:
space:
mode:
authorfahim2015-03-13 11:47:05 +0530
committerfahim2015-03-13 11:47:05 +0530
commited8eee97618542efea1b3fa439f2b10b6c5bd07d (patch)
tree1a60c9e47b61afa5cf62939ade5a26a5ef8fd5e6 /src/projManagement/Validation.py
parent4f46af3248e4516df492f76cf789f80ec7c7e54a (diff)
downloadeSim-ed8eee97618542efea1b3fa439f2b10b6c5bd07d.tar.gz
eSim-ed8eee97618542efea1b3fa439f2b10b6c5bd07d.tar.bz2
eSim-ed8eee97618542efea1b3fa439f2b10b6c5bd07d.zip
Subject: Move Repository to FOSSEE
Description: Move Repository to FOSSEE
Diffstat (limited to 'src/projManagement/Validation.py')
-rw-r--r--src/projManagement/Validation.py74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/projManagement/Validation.py b/src/projManagement/Validation.py
new file mode 100644
index 00000000..33f0894f
--- /dev/null
+++ b/src/projManagement/Validation.py
@@ -0,0 +1,74 @@
+
+#===============================================================================
+#
+# FILE: Validation.py
+#
+# USAGE: ---
+#
+# DESCRIPTION: This module is use to create validation for openProject,newProject and other activity.
+#
+# OPTIONS: ---
+# REQUIREMENTS: ---
+# BUGS: ---
+# NOTES: ---
+# AUTHOR: Fahim Khan, fahim.elex@gmail.com
+# ORGANIZATION: eSim team at FOSSEE, IIT Bombay.
+# CREATED: Wednesday 12 February 2015
+# REVISION: ---
+#===============================================================================
+import os
+import re
+
+
+class Validation:
+ def __init__(self):
+ pass
+
+ def validateOpenproj(self,projDir):
+ print "Validate openProj called"
+ projName = os.path.basename(str(projDir))
+ lookProj = os.path.join(str(projDir),projName+".proj")
+ #Check existence of project
+ if os.path.exists(lookProj):
+ return True
+ else:
+ return False
+
+
+
+
+ def validateNewproj(self,projDir):
+ print "Validate newProj called"
+ print "Project Directory : ",projDir
+ #Checking existence of project with same name
+
+ if os.path.exists(projDir):
+ return "CHECKEXIST" #Project with name already exist
+ else:
+ #Check Proper name for project. It should not have space
+ if re.search(r"\s",projDir ):
+ return "CHECKNAME"
+ else:
+ return "VALID"
+
+ def validateKicad(self,projDir):
+ print "Validation for Kicad components"
+ if projDir == None:
+ return False
+ else:
+ return True
+
+ def validateCir(self,projDir):
+ print "Checking if .cir file is present or not"
+ projName = os.path.basename(str(projDir))
+ lookCir = os.path.join(str(projDir),projName+".cir")
+ #Check existence of project
+ if os.path.exists(lookCir):
+ return True
+ else:
+ return False
+
+
+
+
+ \ No newline at end of file