--- a/MultiProject/MultiProject.py Tue Oct 15 22:03:54 2013 +0200 +++ b/MultiProject/MultiProject.py Fri Oct 18 23:00:41 2013 +0200 @@ -62,7 +62,8 @@ @param project reference to the project object (Project.Project) @param parent parent widget (usually the ui object) (QWidget) - @param filename optional filename of a multi project file to open (string) + @param filename optional filename of a multi project file to open + (string) """ super(MultiProject, self).__init__(parent) @@ -88,10 +89,12 @@ self.description = "" # description of the multi project self.name = "" self.opened = False - self.projects = [] # list of project info; each info entry is a dictionary + self.projects = [] # list of project info; each info entry is + # a dictionary # 'name' : Name of the project # 'file' : project filename - # 'master' : flag indicating the master project + # 'master' : flag indicating the master + # project # 'description' : description of the project def __loadRecent(self): @@ -110,7 +113,8 @@ """ Private method to save the list of recently opened filenames. """ - Preferences.Prefs.rsettings.setValue(recentNameMultiProject, self.recent) + Preferences.Prefs.rsettings.setValue( + recentNameMultiProject, self.recent) Preferences.Prefs.rsettings.sync() def getMostRecent(self): @@ -205,8 +209,9 @@ QApplication.restoreOverrideCursor() E5MessageBox.critical(self.ui, self.trUtf8("Read multiproject file"), - self.trUtf8("<p>The multiproject file <b>{0}</b> could not be read.</p>")\ - .format(fn)) + self.trUtf8( + "<p>The multiproject file <b>{0}</b> could not be" + " read.</p>").format(fn)) return False self.pfile = os.path.abspath(fn) @@ -227,10 +232,10 @@ Private method to save the multi project infos to a multi project file. @param fn optional filename of the multi project file to be written. - If fn is None, the filename stored in the multi project object - is used. This is the 'save' action. If fn is given, this filename - is used instead of the one in the multi project object. This is the - 'save as' action. + If fn is None, the filename stored in the multi project object + is used. This is the 'save' action. If fn is given, this filename + is used instead of the one in the multi project object. This is the + 'save as' action. @return flag indicating success """ if fn is None: @@ -239,7 +244,8 @@ f = QFile(fn) if f.open(QIODevice.WriteOnly): from E5XML.MultiProjectWriter import MultiProjectWriter - MultiProjectWriter(f, self, os.path.splitext(os.path.basename(fn))[0])\ + MultiProjectWriter( + f, self, os.path.splitext(os.path.basename(fn))[0])\ .writeXML() res = True else: @@ -351,7 +357,8 @@ """ Public slot to remove a project from the multi project. - @param fn filename of the project to be removed from the multi project (string) + @param fn filename of the project to be removed from the multi + project (string) """ for project in self.projects: if project['file'] == fn: @@ -398,7 +405,8 @@ """ Public slot to open a multi project. - @param fn optional filename of the multi project file to be read (string) + @param fn optional filename of the multi project file to be + read (string) @param openMaster flag indicating, that the master project should be opened depending on the configuration (boolean) """ @@ -409,7 +417,8 @@ fn = E5FileDialog.getOpenFileName( self.parent(), self.trUtf8("Open multiproject"), - Preferences.getMultiProject("Workspace") or Utilities.getHomeDir(), + Preferences.getMultiProject("Workspace") or \ + Utilities.getHomeDir(), self.trUtf8("Multiproject Files (*.e4m)")) if fn == "": @@ -433,7 +442,8 @@ self.multiProjectOpened.emit() - if openMaster and Preferences.getMultiProject("OpenMasterAutomatically"): + if openMaster and Preferences.getMultiProject( + "OpenMasterAutomatically"): self.__openMasterProject(False) else: QApplication.restoreOverrideCursor() @@ -585,7 +595,8 @@ self.closeAct = E5Action(self.trUtf8('Close multiproject'), UI.PixmapCache.getIcon("multiProjectClose.png"), self.trUtf8('&Close'), 0, 0, self, 'multi_project_close') - self.closeAct.setStatusTip(self.trUtf8('Close the current multiproject')) + self.closeAct.setStatusTip(self.trUtf8( + 'Close the current multiproject')) self.closeAct.setWhatsThis(self.trUtf8( """<b>Close</b>""" """<p>This closes the current multiproject.</p>""" @@ -606,7 +617,8 @@ self.saveasAct = E5Action(self.trUtf8('Save multiproject as'), UI.PixmapCache.getIcon("multiProjectSaveAs.png"), - self.trUtf8('Save &as...'), 0, 0, self, 'multi_project_save_as') + self.trUtf8('Save &as...'), 0, 0, self, + 'multi_project_save_as') self.saveasAct.setStatusTip(self.trUtf8( 'Save the current multiproject to a new file')) self.saveasAct.setWhatsThis(self.trUtf8( @@ -616,10 +628,11 @@ self.saveasAct.triggered[()].connect(self.saveMultiProjectAs) self.actions.append(self.saveasAct) - self.addProjectAct = E5Action(self.trUtf8('Add project to multiproject'), - UI.PixmapCache.getIcon("fileProject.png"), - self.trUtf8('Add &project...'), 0, 0, - self, 'multi_project_add_project') + self.addProjectAct = E5Action( + self.trUtf8('Add project to multiproject'), + UI.PixmapCache.getIcon("fileProject.png"), + self.trUtf8('Add &project...'), 0, 0, + self, 'multi_project_add_project') self.addProjectAct.setStatusTip(self.trUtf8( 'Add a project to the current multiproject')) self.addProjectAct.setWhatsThis(self.trUtf8( @@ -632,11 +645,14 @@ self.propsAct = E5Action(self.trUtf8('Multiproject properties'), UI.PixmapCache.getIcon("multiProjectProps.png"), - self.trUtf8('&Properties...'), 0, 0, self, 'multi_project_properties') - self.propsAct.setStatusTip(self.trUtf8('Show the multiproject properties')) + self.trUtf8('&Properties...'), 0, 0, self, + 'multi_project_properties') + self.propsAct.setStatusTip(self.trUtf8( + 'Show the multiproject properties')) self.propsAct.setWhatsThis(self.trUtf8( """<b>Properties...</b>""" - """<p>This shows a dialog to edit the multiproject properties.</p>""" + """<p>This shows a dialog to edit the multiproject""" + """ properties.</p>""" )) self.propsAct.triggered[()].connect(self.__showProperties) self.actions.append(self.propsAct) @@ -654,7 +670,8 @@ @return the menu generated (QMenu) """ menu = QMenu(self.trUtf8('&Multiproject'), self.parent()) - self.recentMenu = QMenu(self.trUtf8('Open &Recent Multiprojects'), menu) + self.recentMenu = QMenu(self.trUtf8('Open &Recent Multiprojects'), + menu) self.__menus = { "Main": menu, @@ -687,7 +704,8 @@ """ Public slot to initialize the multi project toolbar. - @param toolbarManager reference to a toolbar manager object (E5ToolBarManager) + @param toolbarManager reference to a toolbar manager object + (E5ToolBarManager) @return the toolbar generated (QToolBar) """ tb = QToolBar(self.trUtf8("Multiproject"), self.ui) @@ -717,8 +735,8 @@ def __syncRecent(self): """ - Private method to synchronize the list of recently opened multi projects - with the central store. + Private method to synchronize the list of recently opened multi + projects with the central store. """ for recent in self.recent[:]: if Utilities.samepath(self.pfile, recent):