diff options
Diffstat (limited to 'src/projManagement')
-rw-r--r-- | src/projManagement/Validation.py | 40 | ||||
-rw-r--r-- | src/projManagement/newProject.py | 2 | ||||
-rw-r--r-- | src/projManagement/openProject.py | 61 |
3 files changed, 102 insertions, 1 deletions
diff --git a/src/projManagement/Validation.py b/src/projManagement/Validation.py new file mode 100644 index 00000000..b53dfe49 --- /dev/null +++ b/src/projManagement/Validation.py @@ -0,0 +1,40 @@ + +#=============================================================================== +# +# 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: ecSim team at FOSSEE, IIT Bombay. +# CREATED: Wednesday 12 February 2015 +# REVISION: --- +#=============================================================================== +import os + + +class Validation: + def __init__(self): + pass + + def validateOpenproj(self,proj_directory): + print "Valid open Proj called" + tempStr = proj_directory.split('/') + projName = tempStr[len(tempStr)-1] + if os.path.exists(proj_directory+"/"+projName+".proj"): + return True + else: + return False + + + def validateNewproj(self): + print "Valid new Proj called" + + +
\ No newline at end of file diff --git a/src/projManagement/newProject.py b/src/projManagement/newProject.py index 59ece47d..1bbbbaf7 100644 --- a/src/projManagement/newProject.py +++ b/src/projManagement/newProject.py @@ -13,7 +13,7 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # ORGANIZATION: ecSim team at FOSSEE, IIT Bombay. -# CREATED: Wednesday 04 February 2015 +# CREATED: Wednesday 12 February 2015 # REVISION: --- #=============================================================================== diff --git a/src/projManagement/openProject.py b/src/projManagement/openProject.py new file mode 100644 index 00000000..a5c8c323 --- /dev/null +++ b/src/projManagement/openProject.py @@ -0,0 +1,61 @@ + +#=============================================================================== +# +# FILE: openProject.py +# +# USAGE: --- +# +# DESCRIPTION: It is called whenever new project is being called. +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: Fahim Khan, fahim.elex@gmail.com +# ORGANIZATION: ecSim team at FOSSEE, IIT Bombay. +# CREATED: Wednesday 12 February 2015 +# REVISION: --- +#=============================================================================== + +from PyQt4 import QtGui +from Validation import Validation +from configuration.Appconfig import Appconfig + + + +class ProjectInfo: + """ + Class ProjectInfo accept model information from user + + """ + def __init__(self): + pass + + def body(self): + print "Create Dialog box" + self.proj_directory = QtGui.QFileDialog.getExistingDirectory() + self.obj_validation = Validation() + + + if self.obj_validation.validateOpenproj(self.proj_directory) == True: + print "Pass open project test" + self.obj_Appconfig = Appconfig() + self.obj_Appconfig.current_project['ProjectName'] = self.proj_directory + + + else: + print "Failed open project test" + reply = QtGui.QMessageBox.critical(None, "Error Message",'''<b> Error: The project doesn't contain .proj file.</b><br/> + <b>Please select the proper project directory else you won't be able to perform any operation</b>''',QtGui.QMessageBox.Ok|QtGui.QMessageBox.Cancel) + if reply == QtGui.QMessageBox.Ok: + self.body() + elif reply == QtGui.QMessageBox.Cancel: + pass + else: + pass + + + + + +
\ No newline at end of file |