From 1c7c55e71124ab3291b4b8091a85c00278cb425d Mon Sep 17 00:00:00 2001 From: anjalijaiswal08 Date: Thu, 27 Jun 2019 00:13:54 +0530 Subject: Added loop and condition --- src/frontEnd/ProjectExplorer.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/frontEnd') diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py index 1273a545..8f2c29b5 100644 --- a/src/frontEnd/ProjectExplorer.py +++ b/src/frontEnd/ProjectExplorer.py @@ -248,9 +248,20 @@ class ProjectExplorer(QtGui.QWidget): print(newBaseFileName) print("=================") newBaseFileName = str(newBaseFileName) - projectPath, projectFiles = list( - self.obj_appconfig.project_explorer.items())[ - self.indexItem.row()] + i = 0 + print(self.indexItem.row()) + print("=================") + + for parents, children in list( + self.obj_appconfig.project_explorer.items()): + print(parents) + print("-------------------") + if os.path.exists(parents): + i += 1 + if i == self.indexItem.row(): + projectPath, projectFiles = list( + self.obj_appconfig.project_explorer.items())[i] + updatedProjectFiles = [] self.workspace = self.obj_appconfig.default_workspace['workspace'] @@ -273,7 +284,6 @@ class ProjectExplorer(QtGui.QWidget): else: reply = self.obj_validation.validateNewproj(str(projDir)) - print(reply) print("==================") # rename files matching project name @@ -283,7 +293,7 @@ class ProjectExplorer(QtGui.QWidget): oldFilePath = os.path.join(projectPath, projectFile) projectFile = projectFile.replace( - self.baseFileNam, newBaseFileName, 1) + self.baseFileName, newBaseFileName, 1) newFilePath = os.path.join( projectPath, projectFile) print(oldFilePath) -- cgit