diff options
author | fahim | 2015-02-19 17:55:15 +0530 |
---|---|---|
committer | fahim | 2015-02-19 17:55:15 +0530 |
commit | 22254c4024c72f71de4d4fc0b71bbb22fac8a747 (patch) | |
tree | 5e0904bdfcbd1b27e0e74cd89285740c4c8a48e1 /src/projManagement/Validation.py | |
parent | d7553c754ceb107042d75345e3c77115fdd735ab (diff) | |
download | eSim-22254c4024c72f71de4d4fc0b71bbb22fac8a747.tar.gz eSim-22254c4024c72f71de4d4fc0b71bbb22fac8a747.tar.bz2 eSim-22254c4024c72f71de4d4fc0b71bbb22fac8a747.zip |
Subject: Modiefied newProject.py and added few icons
Description: Moddiefied newProject.py with few validation check and
icons for newProject ,CloseProject and openProject
Diffstat (limited to 'src/projManagement/Validation.py')
-rw-r--r-- | src/projManagement/Validation.py | 25 |
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 |