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/newProject.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/newProject.py')
-rw-r--r-- | src/projManagement/newProject.py | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/projManagement/newProject.py b/src/projManagement/newProject.py index f7670033..146b0080 100644 --- a/src/projManagement/newProject.py +++ b/src/projManagement/newProject.py @@ -17,7 +17,9 @@ # REVISION: --- #=============================================================================== from PyQt4 import QtGui,QtCore - +from Validation import Validation +from configuration.Appconfig import Appconfig +import os class NewProjectInfo(QtGui.QWidget): """ @@ -26,6 +28,8 @@ class NewProjectInfo(QtGui.QWidget): def __init__(self): super(NewProjectInfo, self).__init__() + self.obj_validation = Validation() + self.obj_appconfig = Appconfig() def body(self): @@ -79,6 +83,29 @@ class NewProjectInfo(QtGui.QWidget): def createProject(self): print "Create Project Called" + self.workspace = self.obj_appconfig.default_workspace['workspace'] + self.projName = self.projEdit.text() + self.projName = str(self.projName).rstrip().lstrip() #Remove leading and trailing space + + self.project_dir = os.path.join(self.workspace,str(self.projName)) + + self.reply = self.obj_validation.validateNewproj(str(self.project_dir)) + + if self.reply == "VALID": + print "Validated : Creating project directory" + #create project directory + print "Check : ",self.project_dir + try: + os.mkdir(self.project_dir) + self.close() + except: + print "Some Thing Wrong" + + elif self.reply == "CHECKEXIST": + print "Project already exist" + + elif self.reply == "CHECKNAME": + print "Name is not proper" def cancelProject(self): self.close() |