From 22254c4024c72f71de4d4fc0b71bbb22fac8a747 Mon Sep 17 00:00:00 2001 From: fahim Date: Thu, 19 Feb 2015 17:55:15 +0530 Subject: Subject: Modiefied newProject.py and added few icons Description: Moddiefied newProject.py with few validation check and icons for newProject ,CloseProject and openProject --- src/projManagement/newProject.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'src/projManagement/newProject.py') 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() -- cgit