diff options
Diffstat (limited to 'src/frontEnd/ProjectExplorer.py')
-rw-r--r-- | src/frontEnd/ProjectExplorer.py | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py index 77b3f124..d84f41e0 100644 --- a/src/frontEnd/ProjectExplorer.py +++ b/src/frontEnd/ProjectExplorer.py @@ -4,8 +4,16 @@ import json from configuration.Appconfig import Appconfig +# This is main class for Project Explorer Area. class ProjectExplorer(QtGui.QWidget): + """ """ + def __init__(self): + """ + This method is doing following tasks: + a)initializing objects used in full program. + b)view of project explorer area. + """ QtGui.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.treewidget = QtGui.QTreeWidget() @@ -37,8 +45,8 @@ class ProjectExplorer(QtGui.QWidget): os.path.join(parents) if os.path.exists(parents): pathlist = parents.split(os.sep) - parentnode = QtGui.QTreeWidgetItem( - self.treewidget, [pathlist[-1], parents]) + parentnode = QtGui.QTreeWidgetItem(self.treewidget, + [pathlist[-1], parents]) for files in children: QtGui.QTreeWidgetItem( parentnode, [files, os.path.join(parents, files)]) @@ -73,7 +81,6 @@ class ProjectExplorer(QtGui.QWidget): indexes = self.treewidget.selectedIndexes() if len(indexes) > 0: - level = 0 index = indexes[0] while index.parent().isValid(): @@ -132,25 +139,35 @@ class ProjectExplorer(QtGui.QWidget): else: self.obj_appconfig.current_project["ProjectName"] = str( self.filePath) - self.obj_appconfig.proc_dict - [self.obj_appconfig.current_project['ProjectName']] = [ - ] - if self.obj_appconfig.current_project['ProjectName'] \ - not in self.obj_appconfig.dock_dict: + ( + self.obj_appconfig. + proc_dict[self.obj_appconfig.current_project['ProjectName']] + ) = [] + if ( + self.obj_appconfig.current_project['ProjectName'] not in self.obj_appconfig.dock_dict - [self.obj_appconfig.current_project['ProjectName']] = [ - ] - + ): + ( + self.obj_appconfig. + dock_dict[ + self.obj_appconfig.current_project['ProjectName']] + ) = [] + + # This function is enabling save button option. def enable_save(self): self.save.setEnabled(True) + # This function is saving data before it closes the given file. def save_data(self): self.fopen = open(self.filePath, 'w') self.fopen.write(self.text.toPlainText()) self.fopen.close() self.textwindow.close() + # This function removes the project in explorer area by right + # clicking on project and selecting remove option. def removeProject(self): + """ """ self.indexItem = self.treewidget.currentIndex() self.filePath = str( self.indexItem.sibling( @@ -166,7 +183,10 @@ class ProjectExplorer(QtGui.QWidget): json.dump(self.obj_appconfig.project_explorer, open(self.obj_appconfig.dictPath, 'w')) + # This function refresh the project in explorer area by right + # clicking on project and selecting refresh option. def refreshProject(self): + """ """ self.indexItem = self.treewidget.currentIndex() self.filePath = str( self.indexItem.sibling( |