diff options
author | nilshah98 | 2019-06-07 19:15:54 +0530 |
---|---|---|
committer | nilshah98 | 2019-06-13 12:18:39 +0530 |
commit | 89c637c341a281d31ccd63be65a3504d6db79882 (patch) | |
tree | e46a0272c89123fa0ee01ceb375dcc0f5440472b /src/frontEnd/ProjectExplorer.py | |
parent | daffbbb29757deff785c13a429b4c03fe3f25fba (diff) | |
download | eSim-89c637c341a281d31ccd63be65a3504d6db79882.tar.gz eSim-89c637c341a281d31ccd63be65a3504d6db79882.tar.bz2 eSim-89c637c341a281d31ccd63be65a3504d6db79882.zip |
made pep8 compliant using autopep8 tool
Diffstat (limited to 'src/frontEnd/ProjectExplorer.py')
-rw-r--r-- | src/frontEnd/ProjectExplorer.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py index 658ea12e..cac9f986 100644 --- a/src/frontEnd/ProjectExplorer.py +++ b/src/frontEnd/ProjectExplorer.py @@ -55,7 +55,7 @@ class ProjectExplorer(QtGui.QWidget): pathlist = parents.split(os.sep) parentnode = QtGui.QTreeWidgetItem( self.treewidget, [pathlist[-1], parents] - ) + ) for files in children: QtGui.QTreeWidgetItem( parentnode, [files, os.path.join(parents, files)]) @@ -225,22 +225,24 @@ class ProjectExplorer(QtGui.QWidget): json.dump(self.obj_appconfig.project_explorer, open(self.obj_appconfig.dictPath, 'w')) - #""" + # """ def renameProject(self): indexItem = self.treewidget.currentIndex() baseFileName = str(indexItem.data()) newBaseFileName, ok = QtGui.QInputDialog.getText(self, 'Rename Project', 'Project Name:', - QtGui.QLineEdit.Normal, baseFileName) + QtGui.QLineEdit.Normal, baseFileName) if ok and newBaseFileName: newBaseFileName = str(newBaseFileName) - projectPath, projectFiles = list(self.obj_appconfig.project_explorer.items())[indexItem.row()] + projectPath, projectFiles = list(self.obj_appconfig.project_explorer.items())[ + indexItem.row()] updatedProjectFiles = [] # rename files matching project name for projectFile in projectFiles: if baseFileName in projectFile: oldFilePath = os.path.join(projectPath, projectFile) - projectFile = projectFile.replace(baseFileName, newBaseFileName, 1) + projectFile = projectFile.replace( + baseFileName, newBaseFileName, 1) newFilePath = os.path.join(projectPath, projectFile) print ("Renaming " + oldFilePath + " to " + newFilePath) os.rename(oldFilePath, newFilePath) @@ -248,7 +250,8 @@ class ProjectExplorer(QtGui.QWidget): updatedProjectFiles.append(projectFile) # rename project folder - updatedProjectPath = newBaseFileName.join(projectPath.rsplit(baseFileName, 1)) + updatedProjectPath = newBaseFileName.join( + projectPath.rsplit(baseFileName, 1)) print ("Renaming " + projectPath + " to " + updatedProjectPath) os.rename(projectPath, updatedProjectPath) @@ -257,7 +260,8 @@ class ProjectExplorer(QtGui.QWidget): self.obj_appconfig.project_explorer[updatedProjectPath] = updatedProjectFiles # save project_explorer dictionary on disk - json.dump(self.obj_appconfig.project_explorer, open(self.obj_appconfig.dictPath,'w')) + json.dump(self.obj_appconfig.project_explorer, + open(self.obj_appconfig.dictPath, 'w')) # recreate project explorer tree self.treewidget.clear() |