diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/frontEnd/ProjectExplorer.py | 30 | ||||
-rw-r--r-- | src/projManagement/newProject.py | 10 | ||||
-rw-r--r-- | src/subcircuit/convertSub.py | 4 |
3 files changed, 26 insertions, 18 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": diff --git a/src/projManagement/newProject.py b/src/projManagement/newProject.py index e7fd6548..466570d9 100644 --- a/src/projManagement/newProject.py +++ b/src/projManagement/newProject.py @@ -1,4 +1,3 @@ - # ========================================================================= # # FILE: newProject.py @@ -45,6 +44,13 @@ class NewProjectInfo(QtGui.QWidget): - CHECKNAME - NONE + @params + :projName => name of the project created passed from + frontEnd/Application new_project() + @return + :dirs => The directories inside the project folder + :filelist => The files inside the project folder + """ # print "Create Project Called" self.projName = projName @@ -75,7 +81,7 @@ class NewProjectInfo(QtGui.QWidget): self.msg = QtGui.QErrorMessage(self) self.msg.showMessage( 'Unable to create project. Please make sure you have' - + 'write permission on ' + + ' write permission on ' + self.workspace) self.msg.setWindowTitle("Error Message") f.write("schematicFile " + self.projName + ".sch\n") diff --git a/src/subcircuit/convertSub.py b/src/subcircuit/convertSub.py index 3e32f9b2..7bdccfb2 100644 --- a/src/subcircuit/convertSub.py +++ b/src/subcircuit/convertSub.py @@ -45,11 +45,11 @@ class convertSub(QtGui.QWidget): self.msg = QtGui.QErrorMessage(None) self.msg.showMessage( 'The subcircuit does not contain any Kicad netlist file' - + 'for conversion.') + + ' for conversion.') self.msg.setWindowTitle("Error Message") else: self.msg = QtGui.QErrorMessage(None) self.msg.showMessage( 'Please select the subcircuit first. You can either create' - + 'new subcircuit or open existing subcircuit') + + ' new subcircuit or open existing subcircuit') self.msg.setWindowTitle("Error Message") |