diff options
author | anjalijaiswal08 | 2019-06-26 11:05:16 +0530 |
---|---|---|
committer | anjalijaiswal08 | 2019-06-26 11:05:16 +0530 |
commit | 55871b148c5a6de080b3133acc5eda754736f3ee (patch) | |
tree | 411b34aff6c989fc0a44dc1a38fdb10eaf829255 /src/frontEnd | |
parent | 6dbded9cd04e01b2080282085b4f99018899f49d (diff) | |
download | eSim-55871b148c5a6de080b3133acc5eda754736f3ee.tar.gz eSim-55871b148c5a6de080b3133acc5eda754736f3ee.tar.bz2 eSim-55871b148c5a6de080b3133acc5eda754736f3ee.zip |
Made pep8 compliance
Diffstat (limited to 'src/frontEnd')
-rw-r--r-- | src/frontEnd/ProjectExplorer.py | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py index 7f631c83..3adde8b5 100644 --- a/src/frontEnd/ProjectExplorer.py +++ b/src/frontEnd/ProjectExplorer.py @@ -241,18 +241,18 @@ class ProjectExplorer(QtGui.QWidget): self.indexItem = self.treewidget.currentIndex() self.baseFileName = str(self.indexItem.data()) newBaseFileName, ok = QtGui.QInputDialog.getText( - self, - 'Rename Project', - 'Project Name:', - QtGui.QLineEdit.Normal, - self.baseFileName - ) + self, 'Rename Project', 'Project Name:', QtGui.QLineEdit.Normal, + self.baseFileName + ) + if ok and newBaseFileName: print("=================") print(newBaseFileName) print("=================") newBaseFileName = str(newBaseFileName) - projectPath, projectFiles = list(self.obj_appconfig.project_explorer.items())[self.indexItem.row()] + projectPath, projectFiles = list( + self.obj_appconfig.project_explorer.items())[ + self.indexItem.row()] updatedProjectFiles = [] self.workspace = self.obj_appconfig.default_workspace['workspace'] @@ -285,10 +285,9 @@ class ProjectExplorer(QtGui.QWidget): oldFilePath = os.path.join(projectPath, projectFile) projectFile = projectFile.replace( - self.baseFileName, - newBaseFileName, - 1) - newFilePath = os.path.join(projectPath, projectFile) + self.baseFileNam, newBaseFileName, 1) + newFilePath = os.path.join( + projectPath, projectFile) print(oldFilePath) print("==================") print(newFilePath) @@ -300,7 +299,8 @@ class ProjectExplorer(QtGui.QWidget): updatedProjectFiles.append(projectFile) # rename project folder - updatedProjectPath = newBaseFileName.join(projectPath.rsplit(self.baseFileName, 1)) + updatedProjectPath = newBaseFileName.join( + projectPath.rsplit(self.baseFileName, 1)) print ("Renaming " + projectPath + " to " @@ -309,7 +309,8 @@ class ProjectExplorer(QtGui.QWidget): # update project_explorer dictionary del self.obj_appconfig.project_explorer[projectPath] - self.obj_appconfig.project_explorer[updatedProjectPath] = updatedProjectFiles + self.obj_appconfig.project_explorer[updatedProjectPath] = \ + updatedProjectFiles # save project_explorer dictionary on disk json.dump(self.obj_appconfig.project_explorer, open( @@ -317,7 +318,8 @@ class ProjectExplorer(QtGui.QWidget): # recreate project explorer tree self.treewidget.clear() - for parent, children in self.obj_appconfig.project_explorer.items(): + for parent, children in \ + self.obj_appconfig.project_explorer.items(): self.addTreeNode(parent, children) elif reply == "CHECKEXIST": |