summaryrefslogtreecommitdiff
path: root/src/projManagement/Validation.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/projManagement/Validation.py')
-rw-r--r--src/projManagement/Validation.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/projManagement/Validation.py b/src/projManagement/Validation.py
index 70b29ab5..864ac448 100644
--- a/src/projManagement/Validation.py
+++ b/src/projManagement/Validation.py
@@ -17,6 +17,7 @@
# REVISION: ---
#===============================================================================
import os
+import re
class Validation:
@@ -24,17 +25,35 @@ class Validation:
pass
def validateOpenproj(self,proj_directory):
- print "Valid open Proj called"
+ print "Validate openProj called"
projName = os.path.basename(str(proj_directory))
lookProj = os.path.join(str(proj_directory),projName+".proj")
+ #Check existence of project
if os.path.exists(lookProj):
return True
else:
return False
+
+
- def validateNewproj(self):
- print "Valid new Proj called"
+ def validateNewproj(self,project_dir):
+ print "Validate newProj called"
+ print "Project Directory : ",project_dir
+ #Checking existence of project with same name
+
+ if os.path.exists(project_dir):
+ return "CHECKEXIST" #Project with name already exist
+ else:
+
+ #Check Proper name for project. It should not have space
+
+ if re.search(r"\s",project_dir ):
+ return "CHECKNAME"
+ else:
+ return "VALID"
+
+
\ No newline at end of file