summaryrefslogtreecommitdiff
path: root/src/frontEnd/ProjectExplorer.py
diff options
context:
space:
mode:
authorSunil Shetye2019-06-13 13:11:14 +0530
committerGitHub2019-06-13 13:11:14 +0530
commitcfc34bb19977e738582620802415ccde27a03039 (patch)
treedaaace10133835956619b401aca9c252e3e789bc /src/frontEnd/ProjectExplorer.py
parent25c6eddcea3c8a62d9750a78435454544d8c7b14 (diff)
parent20b23a7934f7cf01cd5b4353ddd2e008b40e5ffd (diff)
downloadeSim-cfc34bb19977e738582620802415ccde27a03039.tar.gz
eSim-cfc34bb19977e738582620802415ccde27a03039.tar.bz2
eSim-cfc34bb19977e738582620802415ccde27a03039.zip
Merge pull request #86 from nilshah98/documentation
Documentation added and minor fixes
Diffstat (limited to 'src/frontEnd/ProjectExplorer.py')
-rw-r--r--src/frontEnd/ProjectExplorer.py42
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(