--- a/Project/Project.py Fri Oct 18 23:00:41 2013 +0200 +++ b/Project/Project.py Fri Nov 01 15:48:48 2013 +0100 @@ -295,8 +295,8 @@ return type_ in self.__projectTypes def registerProjectType(self, type_, description, fileTypeCallback=None, - binaryTranslationsCallback=None, lexerAssociationCallback=None, - progLanguages=None): + binaryTranslationsCallback=None, + lexerAssociationCallback=None, progLanguages=None): """ Public method to register a project type. @@ -316,7 +316,8 @@ if progLanguages: for progLanguage in progLanguages: if progLanguage not in self.__projectProgLanguages: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Registering Project Type"), self.trUtf8( """<p>The Programming Language <b>{0}</b> is not""" @@ -326,7 +327,8 @@ return if type_ in self.__projectProgLanguages[progLanguage]: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Registering Project Type"), self.trUtf8( """<p>The Project type <b>{0}</b> is already""" @@ -337,7 +339,8 @@ return if type_ in self.__projectTypes: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Registering Project Type"), self.trUtf8("""<p>The Project type <b>{0}</b> is already""" """ registered.</p>""").format(type_) @@ -670,7 +673,8 @@ f.close() else: QApplication.restoreOverrideCursor() - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Read project file"), self.trUtf8( "<p>The project file <b>{0}</b> could not be read.</p>")\ @@ -769,7 +773,8 @@ os.path.basename(fn))[0]).writeXML() res = True else: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Save project file"), self.trUtf8( "<p>The project file <b>{0}</b> could not be" @@ -804,7 +809,8 @@ reader.readXML() f.close() else: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Read user project properties"), self.trUtf8( "<p>The user specific project properties file" @@ -827,7 +833,8 @@ f, os.path.splitext(os.path.basename(fn))[0]).writeXML() f.close() else: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Save user project properties"), self.trUtf8( "<p>The user specific project properties file <b>{0}</b>" @@ -860,7 +867,8 @@ """ if self.pfile is None: if not quiet: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Read project session"), self.trUtf8("Please save the project first.")) return @@ -877,7 +885,8 @@ f.close() else: if not quiet: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Read project session"), self.trUtf8( "<p>The project session file <b>{0}</b> could not be" @@ -893,7 +902,8 @@ """ if self.pfile is None: if not quiet: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Save project session"), self.trUtf8("Please save the project first.")) return @@ -910,7 +920,8 @@ f.close() else: if not quiet: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Save project session"), self.trUtf8( "<p>The project session file <b>{0}</b> could not be" @@ -921,7 +932,8 @@ Private method to delete the session file. """ if self.pfile is None: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Delete project session"), self.trUtf8("Please save the project first.")) return @@ -934,7 +946,8 @@ try: os.remove(fn) except OSError: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Delete project session"), self.trUtf8( "<p>The project session file <b>{0}</b> could" @@ -945,7 +958,8 @@ Private method to read in the project tasks file (.e4t). """ if self.pfile is None: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Read tasks"), self.trUtf8("Please save the project first.")) return @@ -961,7 +975,8 @@ reader.readXML() f.close() else: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Read tasks"), self.trUtf8( "<p>The tasks file <b>{0}</b> could not be read.</p>")\ @@ -980,7 +995,8 @@ f = QFile(fn) ok = f.open(QIODevice.WriteOnly) if not ok: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Save tasks"), self.trUtf8( "<p>The tasks file <b>{0}</b> could not be written.</p>") @@ -1018,7 +1034,8 @@ """ if self.pfile is None: if not quiet: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Read debugger properties"), self.trUtf8("Please save the project first.")) return @@ -1034,7 +1051,8 @@ f.close() else: if not quiet: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Read debugger properties"), self.trUtf8( "<p>The project debugger properties file <b>{0}</b>" @@ -1049,7 +1067,8 @@ """ if self.pfile is None: if not quiet: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Save debugger properties"), self.trUtf8("Please save the project first.")) return @@ -1065,7 +1084,8 @@ f.close() else: if not quiet: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Save debugger properties"), self.trUtf8( "<p>The project debugger properties file <b>{0}</b>" @@ -1076,7 +1096,8 @@ Private method to delete the project debugger properties file (.e4d). """ if self.pfile is None: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Delete debugger properties"), self.trUtf8("Please save the project first.")) return @@ -1089,7 +1110,8 @@ try: os.remove(fn) except OSError: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Delete debugger properties"), self.trUtf8( "<p>The project debugger properties file" @@ -1184,7 +1206,8 @@ """ if len(self.pdata["TRANSLATIONPATTERN"]) == 0 or \ self.pdata["TRANSLATIONPATTERN"][0] == '': - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Add Language"), self.trUtf8( "You have to specify a translation pattern first.")) @@ -1257,7 +1280,7 @@ if self.pdata["TRANSLATIONSBINPATH"]: qmFile = self.getRelativePath( os.path.join(self.pdata["TRANSLATIONSBINPATH"][0], - os.path.basename(qmFile))) + os.path.basename(qmFile))) self.pdata["TRANSLATIONS"].remove(qmFile) self.__model.removeItem(qmFile) except ValueError: @@ -1278,7 +1301,8 @@ if os.path.exists(fn): os.remove(fn) except IOError: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Delete translation"), self.trUtf8( "<p>The selected translation file <b>{0}</b> could not be" @@ -1293,12 +1317,13 @@ if self.pdata["TRANSLATIONSBINPATH"]: qmFile = self.getRelativePath( os.path.join(self.pdata["TRANSLATIONSBINPATH"][0], - os.path.basename(qmFile))) + os.path.basename(qmFile))) fn = os.path.join(self.ppath, qmFile) if os.path.exists(fn): os.remove(fn) except IOError: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Delete translation"), self.trUtf8( "<p>The selected translation file <b>{0}</b> could" @@ -1422,7 +1447,8 @@ os.makedirs(target) if os.path.exists(targetfile): - res = E5MessageBox.yesNo(self.ui, + res = E5MessageBox.yesNo( + self.ui, self.trUtf8("Add file"), self.trUtf8( "<p>The file <b>{0}</b> already" @@ -1434,7 +1460,8 @@ shutil.copy(fn, target) except IOError as why: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Add file"), self.trUtf8( "<p>The selected file <b>{0}</b> could" @@ -1445,7 +1472,8 @@ self.appendFile(targetfile, isSource or filter == 'source') else: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Add file"), self.trUtf8("The target directory must not be empty.")) @@ -1475,9 +1503,11 @@ if len(files) == 0: if not quiet: - E5MessageBox.information(self.ui, + E5MessageBox.information( + self.ui, self.trUtf8("Add directory"), - self.trUtf8("<p>The source directory doesn't contain" + self.trUtf8( + "<p>The source directory doesn't contain" " any files belonging to the selected category.</p>")) return @@ -1486,7 +1516,8 @@ try: os.makedirs(target) except IOError as why: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Add directory"), self.trUtf8( "<p>The target directory <b>{0}</b> could not be" @@ -1503,7 +1534,8 @@ if not Utilities.samepath(target, source): try: if os.path.exists(targetfile): - res = E5MessageBox.yesNo(self.ui, + res = E5MessageBox.yesNo( + self.ui, self.trUtf8("Add directory"), self.trUtf8( "<p>The file <b>{0}</b> already exists.</p>" @@ -1556,7 +1588,8 @@ if dlg.exec_() == QDialog.Accepted: filetype, source, target, recursive = dlg.getData() if target == '': - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Add directory"), self.trUtf8("The target directory must not be empty.")) return @@ -1566,7 +1599,8 @@ return if source == '': - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Add directory"), self.trUtf8("The source directory must not be empty.")) return @@ -1700,7 +1734,8 @@ newfn = Utilities.toNativeSeparators(newfn) if os.path.exists(newfn): - res = E5MessageBox.yesNo(self.ui, + res = E5MessageBox.yesNo( + self.ui, self.trUtf8("Rename File"), self.trUtf8("""<p>The file <b>{0}</b> already exists.""" """ Overwrite it?</p>""") @@ -1712,7 +1747,8 @@ try: os.rename(oldfn, newfn) except OSError as msg: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Rename File"), self.trUtf8( """<p>The file <b>{0}</b> could not be renamed.<br />""" @@ -1903,7 +1939,8 @@ for f in glob.glob(pat): os.remove(f) except EnvironmentError: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Delete file"), self.trUtf8( "<p>The selected file <b>{0}</b> could not be" @@ -1927,9 +1964,11 @@ try: shutil.rmtree(dn, True) except EnvironmentError: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Delete directory"), - self.trUtf8("<p>The selected directory <b>{0}</b> could not be" + self.trUtf8( + "<p>The selected directory <b>{0}</b> could not be" " deleted.</p>").format(dn)) return False @@ -2008,7 +2047,8 @@ try: os.makedirs(self.ppath) except EnvironmentError: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Create project directory"), self.trUtf8( "<p>The project directory <b>{0}</b> could not" @@ -2065,7 +2105,8 @@ f = open(ms, "w") f.close() except IOError as err: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Create main script"), self.trUtf8( "<p>The mainscript <b>{0}</b> could not" @@ -2076,7 +2117,8 @@ ms = "" # add existing files to the project - res = E5MessageBox.yesNo(self.ui, + res = E5MessageBox.yesNo( + self.ui, self.trUtf8("New Project"), self.trUtf8("""Add existing files to the project?"""), yesDefault=True) @@ -2125,7 +2167,8 @@ self.setDirty(True) if self.vcs is not None: # edit VCS command options - vcores = E5MessageBox.yesNo(self.ui, + vcores = E5MessageBox.yesNo( + self.ui, self.trUtf8("New Project"), self.trUtf8( """Would you like to edit the VCS""" @@ -2138,7 +2181,8 @@ self.vcs.vcsSetOptions(codlg.getOptions()) # add project file to repository if res == 0: - apres = E5MessageBox.yesNo(self.ui, + apres = E5MessageBox.yesNo( + self.ui, self.trUtf8("New project"), self.trUtf8( "Shall the project file be added" @@ -2188,7 +2232,8 @@ self.setDirty(True) if self.vcs is not None: # edit VCS command options - vcores = E5MessageBox.yesNo(self.ui, + vcores = E5MessageBox.yesNo( + self.ui, self.trUtf8("New Project"), self.trUtf8( """Would you like to edit the VCS command""" @@ -2646,7 +2691,8 @@ if ex: fn += ex if QFileInfo(fn).exists(): - res = E5MessageBox.yesNo(self.ui, + res = E5MessageBox.yesNo( + self.ui, self.trUtf8("Save File"), self.trUtf8("""<p>The file <b>{0}</b> already exists.""" """ Overwrite it?</p>""").format(fn), @@ -2683,7 +2729,8 @@ @return flag indicating whether this operation was successful (boolean) """ if self.isDirty(): - res = E5MessageBox.okToClearData(self.parent(), + res = E5MessageBox.okToClearData( + self.parent(), self.trUtf8("Close Project"), self.trUtf8("The current project has unsaved changes."), self.saveProject) @@ -2812,7 +2859,8 @@ filesWithSyntaxErrors += 1 if reportSyntaxErrors and filesWithSyntaxErrors > 0: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Syntax errors detected"), self.trUtf8( """The project contains %n file(s) with syntax errors.""", @@ -2843,7 +2891,8 @@ filesWithSyntaxErrors += 1 if reportSyntaxErrors and filesWithSyntaxErrors > 0: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Syntax errors detected"), self.trUtf8( """The project contains %n file(s) with syntax errors.""", @@ -3208,10 +3257,11 @@ self.actGrp1 = createActionGroup(self) - act = E5Action(self.trUtf8('New project'), - UI.PixmapCache.getIcon("projectNew.png"), - self.trUtf8('&New...'), 0, 0, - self.actGrp1, 'project_new') + act = E5Action( + self.trUtf8('New project'), + UI.PixmapCache.getIcon("projectNew.png"), + self.trUtf8('&New...'), 0, 0, + self.actGrp1, 'project_new') act.setStatusTip(self.trUtf8('Generate a new project')) act.setWhatsThis(self.trUtf8( """<b>New...</b>""" @@ -3221,10 +3271,11 @@ act.triggered[()].connect(self.createNewProject) self.actions.append(act) - act = E5Action(self.trUtf8('Open project'), - UI.PixmapCache.getIcon("projectOpen.png"), - self.trUtf8('&Open...'), 0, 0, - self.actGrp1, 'project_open') + act = E5Action( + self.trUtf8('Open project'), + UI.PixmapCache.getIcon("projectOpen.png"), + self.trUtf8('&Open...'), 0, 0, + self.actGrp1, 'project_open') act.setStatusTip(self.trUtf8('Open an existing project')) act.setWhatsThis(self.trUtf8( """<b>Open...</b>""" @@ -3233,9 +3284,10 @@ act.triggered[()].connect(self.openProject) self.actions.append(act) - self.closeAct = E5Action(self.trUtf8('Close project'), - UI.PixmapCache.getIcon("projectClose.png"), - self.trUtf8('&Close'), 0, 0, self, 'project_close') + self.closeAct = E5Action( + self.trUtf8('Close project'), + UI.PixmapCache.getIcon("projectClose.png"), + self.trUtf8('&Close'), 0, 0, self, 'project_close') self.closeAct.setStatusTip(self.trUtf8('Close the current project')) self.closeAct.setWhatsThis(self.trUtf8( """<b>Close</b>""" @@ -3244,9 +3296,10 @@ self.closeAct.triggered[()].connect(self.closeProject) self.actions.append(self.closeAct) - self.saveAct = E5Action(self.trUtf8('Save project'), - UI.PixmapCache.getIcon("projectSave.png"), - self.trUtf8('&Save'), 0, 0, self, 'project_save') + self.saveAct = E5Action( + self.trUtf8('Save project'), + UI.PixmapCache.getIcon("projectSave.png"), + self.trUtf8('&Save'), 0, 0, self, 'project_save') self.saveAct.setStatusTip(self.trUtf8('Save the current project')) self.saveAct.setWhatsThis(self.trUtf8( """<b>Save</b>""" @@ -3255,9 +3308,10 @@ self.saveAct.triggered[()].connect(self.saveProject) self.actions.append(self.saveAct) - self.saveasAct = E5Action(self.trUtf8('Save project as'), - UI.PixmapCache.getIcon("projectSaveAs.png"), - self.trUtf8('Save &as...'), 0, 0, self, 'project_save_as') + self.saveasAct = E5Action( + self.trUtf8('Save project as'), + UI.PixmapCache.getIcon("projectSaveAs.png"), + self.trUtf8('Save &as...'), 0, 0, self, 'project_save_as') self.saveasAct.setStatusTip(self.trUtf8( 'Save the current project to a new file')) self.saveasAct.setWhatsThis(self.trUtf8( @@ -3269,10 +3323,11 @@ self.actGrp2 = createActionGroup(self) - self.addFilesAct = E5Action(self.trUtf8('Add files to project'), - UI.PixmapCache.getIcon("fileMisc.png"), - self.trUtf8('Add &files...'), 0, 0, - self.actGrp2, 'project_add_file') + self.addFilesAct = E5Action( + self.trUtf8('Add files to project'), + UI.PixmapCache.getIcon("fileMisc.png"), + self.trUtf8('Add &files...'), 0, 0, + self.actGrp2, 'project_add_file') self.addFilesAct.setStatusTip(self.trUtf8( 'Add files to the current project')) self.addFilesAct.setWhatsThis(self.trUtf8( @@ -3314,9 +3369,10 @@ self.addLanguageAct.triggered[()].connect(self.addLanguage) self.actions.append(self.addLanguageAct) - act = E5Action(self.trUtf8('Search new files'), - self.trUtf8('Searc&h new files...'), 0, 0, - self.actGrp2, 'project_search_new_files') + act = E5Action( + self.trUtf8('Search new files'), + self.trUtf8('Searc&h new files...'), 0, 0, + self.actGrp2, 'project_search_new_files') act.setStatusTip(self.trUtf8( 'Search new files in the project directory.')) act.setWhatsThis(self.trUtf8( @@ -3327,10 +3383,11 @@ act.triggered[()].connect(self.__searchNewFiles) self.actions.append(act) - self.propsAct = E5Action(self.trUtf8('Project properties'), - UI.PixmapCache.getIcon("projectProps.png"), - self.trUtf8('&Properties...'), 0, 0, self, - 'project_properties') + self.propsAct = E5Action( + self.trUtf8('Project properties'), + UI.PixmapCache.getIcon("projectProps.png"), + self.trUtf8('&Properties...'), 0, 0, self, + 'project_properties') self.propsAct.setStatusTip(self.trUtf8('Show the project properties')) self.propsAct.setWhatsThis(self.trUtf8( """<b>Properties...</b>""" @@ -3339,10 +3396,11 @@ self.propsAct.triggered[()].connect(self.__showProperties) self.actions.append(self.propsAct) - self.userPropsAct = E5Action(self.trUtf8('User project properties'), - UI.PixmapCache.getIcon("projectUserProps.png"), - self.trUtf8('&User Properties...'), 0, 0, self, - 'project_user_properties') + self.userPropsAct = E5Action( + self.trUtf8('User project properties'), + UI.PixmapCache.getIcon("projectUserProps.png"), + self.trUtf8('&User Properties...'), 0, 0, self, + 'project_user_properties') self.userPropsAct.setStatusTip(self.trUtf8( 'Show the user specific project properties')) self.userPropsAct.setWhatsThis(self.trUtf8( @@ -3353,9 +3411,10 @@ self.userPropsAct.triggered[()].connect(self.__showUserProperties) self.actions.append(self.userPropsAct) - self.filetypesAct = E5Action(self.trUtf8('Filetype Associations'), - self.trUtf8('Filetype Associations...'), 0, 0, - self, 'project_filetype_associatios') + self.filetypesAct = E5Action( + self.trUtf8('Filetype Associations'), + self.trUtf8('Filetype Associations...'), 0, 0, + self, 'project_filetype_associatios') self.filetypesAct.setStatusTip( self.trUtf8('Show the project filetype associations')) self.filetypesAct.setWhatsThis(self.trUtf8( @@ -3370,9 +3429,10 @@ self.__showFiletypeAssociations) self.actions.append(self.filetypesAct) - self.lexersAct = E5Action(self.trUtf8('Lexer Associations'), - self.trUtf8('Lexer Associations...'), 0, 0, - self, 'project_lexer_associatios') + self.lexersAct = E5Action( + self.trUtf8('Lexer Associations'), + self.trUtf8('Lexer Associations...'), 0, 0, + self, 'project_lexer_associatios') self.lexersAct.setStatusTip(self.trUtf8( 'Show the project lexer associations (overriding defaults)')) self.lexersAct.setWhatsThis(self.trUtf8( @@ -3387,9 +3447,10 @@ self.dbgActGrp = createActionGroup(self) - act = E5Action(self.trUtf8('Debugger Properties'), - self.trUtf8('Debugger &Properties...'), 0, 0, - self.dbgActGrp, 'project_debugger_properties') + act = E5Action( + self.trUtf8('Debugger Properties'), + self.trUtf8('Debugger &Properties...'), 0, 0, + self.dbgActGrp, 'project_debugger_properties') act.setStatusTip(self.trUtf8('Show the debugger properties')) act.setWhatsThis(self.trUtf8( """<b>Debugger Properties...</b>""" @@ -3399,9 +3460,10 @@ act.triggered[()].connect(self.__showDebugProperties) self.actions.append(act) - act = E5Action(self.trUtf8('Load'), - self.trUtf8('&Load'), 0, 0, - self.dbgActGrp, 'project_debugger_properties_load') + act = E5Action( + self.trUtf8('Load'), + self.trUtf8('&Load'), 0, 0, + self.dbgActGrp, 'project_debugger_properties_load') act.setStatusTip(self.trUtf8('Load the debugger properties')) act.setWhatsThis(self.trUtf8( """<b>Load Debugger Properties</b>""" @@ -3410,9 +3472,10 @@ act.triggered[()].connect(self.__readDebugProperties) self.actions.append(act) - act = E5Action(self.trUtf8('Save'), - self.trUtf8('&Save'), 0, 0, - self.dbgActGrp, 'project_debugger_properties_save') + act = E5Action( + self.trUtf8('Save'), + self.trUtf8('&Save'), 0, 0, + self.dbgActGrp, 'project_debugger_properties_save') act.setStatusTip(self.trUtf8('Save the debugger properties')) act.setWhatsThis(self.trUtf8( """<b>Save Debugger Properties</b>""" @@ -3421,9 +3484,10 @@ act.triggered[()].connect(self.__writeDebugProperties) self.actions.append(act) - act = E5Action(self.trUtf8('Delete'), - self.trUtf8('&Delete'), 0, 0, - self.dbgActGrp, 'project_debugger_properties_delete') + act = E5Action( + self.trUtf8('Delete'), + self.trUtf8('&Delete'), 0, 0, + self.dbgActGrp, 'project_debugger_properties_delete') act.setStatusTip(self.trUtf8('Delete the debugger properties')) act.setWhatsThis(self.trUtf8( """<b>Delete Debugger Properties</b>""" @@ -3433,9 +3497,10 @@ act.triggered[()].connect(self.__deleteDebugProperties) self.actions.append(act) - act = E5Action(self.trUtf8('Reset'), - self.trUtf8('&Reset'), 0, 0, - self.dbgActGrp, 'project_debugger_properties_resets') + act = E5Action( + self.trUtf8('Reset'), + self.trUtf8('&Reset'), 0, 0, + self.dbgActGrp, 'project_debugger_properties_resets') act.setStatusTip(self.trUtf8('Reset the debugger properties')) act.setWhatsThis(self.trUtf8( """<b>Reset Debugger Properties</b>""" @@ -3446,9 +3511,10 @@ self.sessActGrp = createActionGroup(self) - act = E5Action(self.trUtf8('Load session'), - self.trUtf8('Load session'), 0, 0, - self.sessActGrp, 'project_load_session') + act = E5Action( + self.trUtf8('Load session'), + self.trUtf8('Load session'), 0, 0, + self.sessActGrp, 'project_load_session') act.setStatusTip(self.trUtf8('Load the projects session file.')) act.setWhatsThis(self.trUtf8( """<b>Load session</b>""" @@ -3463,9 +3529,10 @@ act.triggered[()].connect(self.__readSession) self.actions.append(act) - act = E5Action(self.trUtf8('Save session'), - self.trUtf8('Save session'), 0, 0, - self.sessActGrp, 'project_save_session') + act = E5Action( + self.trUtf8('Save session'), + self.trUtf8('Save session'), 0, 0, + self.sessActGrp, 'project_save_session') act.setStatusTip(self.trUtf8('Save the projects session file.')) act.setWhatsThis(self.trUtf8( """<b>Save session</b>""" @@ -3480,9 +3547,10 @@ act.triggered[()].connect(self.__writeSession) self.actions.append(act) - act = E5Action(self.trUtf8('Delete session'), - self.trUtf8('Delete session'), 0, 0, - self.sessActGrp, 'project_delete_session') + act = E5Action( + self.trUtf8('Delete session'), + self.trUtf8('Delete session'), 0, 0, + self.sessActGrp, 'project_delete_session') act.setStatusTip(self.trUtf8('Delete the projects session file.')) act.setWhatsThis(self.trUtf8( """<b>Delete session</b>""" @@ -3493,9 +3561,10 @@ self.chkGrp = createActionGroup(self) - self.codeMetricsAct = E5Action(self.trUtf8('Code Metrics'), - self.trUtf8('&Code Metrics...'), 0, 0, - self.chkGrp, 'project_code_metrics') + self.codeMetricsAct = E5Action( + self.trUtf8('Code Metrics'), + self.trUtf8('&Code Metrics...'), 0, 0, + self.chkGrp, 'project_code_metrics') self.codeMetricsAct.setStatusTip( self.trUtf8('Show some code metrics for the project.')) self.codeMetricsAct.setWhatsThis(self.trUtf8( @@ -3506,9 +3575,10 @@ self.codeMetricsAct.triggered[()].connect(self.__showCodeMetrics) self.actions.append(self.codeMetricsAct) - self.codeCoverageAct = E5Action(self.trUtf8('Python Code Coverage'), - self.trUtf8('Code Co&verage...'), 0, 0, - self.chkGrp, 'project_code_coverage') + self.codeCoverageAct = E5Action( + self.trUtf8('Python Code Coverage'), + self.trUtf8('Code Co&verage...'), 0, 0, + self.chkGrp, 'project_code_coverage') self.codeCoverageAct.setStatusTip( self.trUtf8('Show code coverage information for the project.')) self.codeCoverageAct.setWhatsThis(self.trUtf8( @@ -3519,9 +3589,10 @@ self.codeCoverageAct.triggered[()].connect(self.__showCodeCoverage) self.actions.append(self.codeCoverageAct) - self.codeProfileAct = E5Action(self.trUtf8('Profile Data'), - self.trUtf8('&Profile Data...'), 0, 0, - self.chkGrp, 'project_profile_data') + self.codeProfileAct = E5Action( + self.trUtf8('Profile Data'), + self.trUtf8('&Profile Data...'), 0, 0, + self.chkGrp, 'project_profile_data') self.codeProfileAct.setStatusTip( self.trUtf8('Show profiling data for the project.')) self.codeProfileAct.setWhatsThis(self.trUtf8( @@ -3547,9 +3618,10 @@ self.handleApplicationDiagram) self.actions.append(self.applicationDiagramAct) - self.loadDiagramAct = E5Action(self.trUtf8('Load Diagram'), - self.trUtf8('&Load Diagram...'), 0, 0, - self.graphicsGrp, 'project_load_diagram') + self.loadDiagramAct = E5Action( + self.trUtf8('Load Diagram'), + self.trUtf8('&Load Diagram...'), 0, 0, + self.graphicsGrp, 'project_load_diagram') self.loadDiagramAct.setStatusTip( self.trUtf8('Load a diagram from file.')) self.loadDiagramAct.setWhatsThis(self.trUtf8( @@ -3561,10 +3633,11 @@ self.pluginGrp = createActionGroup(self) - self.pluginPkgListAct = E5Action(self.trUtf8('Create Package List'), - UI.PixmapCache.getIcon("pluginArchiveList.png"), - self.trUtf8('Create &Package List'), 0, 0, - self.pluginGrp, 'project_plugin_pkglist') + self.pluginPkgListAct = E5Action( + self.trUtf8('Create Package List'), + UI.PixmapCache.getIcon("pluginArchiveList.png"), + self.trUtf8('Create &Package List'), 0, 0, + self.pluginGrp, 'project_plugin_pkglist') self.pluginPkgListAct.setStatusTip( self.trUtf8('Create an initial PKGLIST file for an eric5 plugin.')) self.pluginPkgListAct.setWhatsThis(self.trUtf8( @@ -3576,10 +3649,11 @@ self.pluginPkgListAct.triggered[()].connect(self.__pluginCreatePkgList) self.actions.append(self.pluginPkgListAct) - self.pluginArchiveAct = E5Action(self.trUtf8('Create Plugin Archive'), - UI.PixmapCache.getIcon("pluginArchive.png"), - self.trUtf8('Create Plugin &Archive'), 0, 0, - self.pluginGrp, 'project_plugin_archive') + self.pluginArchiveAct = E5Action( + self.trUtf8('Create Plugin Archive'), + UI.PixmapCache.getIcon("pluginArchive.png"), + self.trUtf8('Create Plugin &Archive'), 0, 0, + self.pluginGrp, 'project_plugin_archive') self.pluginArchiveAct.setStatusTip( self.trUtf8('Create an eric5 plugin archive file.')) self.pluginArchiveAct.setWhatsThis(self.trUtf8( @@ -3802,7 +3876,8 @@ else: formatStr = '{0:d}. {1}' act = self.recentMenu.addAction( - formatStr.format(idx, + formatStr.format( + idx, Utilities.compactPath(rp, self.ui.maxMenuFilePathLen))) act.setData(rp) act.setEnabled(QFileInfo(rp).exists()) @@ -3929,7 +4004,8 @@ # if newfiles is empty, put up message box informing user nothing found if not newFiles: if onUserDemand: - E5MessageBox.information(self.ui, + E5MessageBox.information( + self.ui, self.trUtf8("Search New Files"), self.trUtf8("There were no new files found to be added.")) return @@ -4063,7 +4139,8 @@ if override: # override failed, revert to original QApplication.restoreOverrideCursor() - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Version Control System"), self.trUtf8( "<p>The selected VCS <b>{0}</b> could not be" @@ -4073,7 +4150,8 @@ return self.initVCS(nooverride=True) QApplication.restoreOverrideCursor() - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Version Control System"), self.trUtf8( "<p>The selected VCS <b>{0}</b> could not be" @@ -4175,8 +4253,8 @@ """ Private slot used to calculate some code metrics for the project files. """ - files = [os.path.join(self.ppath, file) \ - for file in self.pdata["SOURCES"] if file.endswith(".py")] + files = [os.path.join(self.ppath, file) + for file in self.pdata["SOURCES"] if file.endswith(".py")] from DataViews.CodeMetricsDialog import CodeMetricsDialog self.codemetrics = CodeMetricsDialog() self.codemetrics.show() @@ -4189,9 +4267,11 @@ """ fn = self.getMainScript(True) if fn is None: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Coverage Data"), - self.trUtf8("There is no main script defined for the" + self.trUtf8( + "There is no main script defined for the" " current project. Aborting")) return @@ -4223,8 +4303,8 @@ else: return - files = [os.path.join(self.ppath, file) \ - for file in self.pdata["SOURCES"] if file.endswith(".py")] + files = [os.path.join(self.ppath, file) + for file in self.pdata["SOURCES"] if file.endswith(".py")] from DataViews.PyCoverageDialog import PyCoverageDialog self.codecoverage = PyCoverageDialog() self.codecoverage.show() @@ -4236,9 +4316,11 @@ """ fn = self.getMainScript(True) if fn is None: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Profile Data"), - self.trUtf8("There is no main script defined for the" + self.trUtf8( + "There is no main script defined for the" " current project. Aborting")) return @@ -4311,7 +4393,8 @@ """ Private method to handle the application diagram context menu action. """ - res = E5MessageBox.yesNo(self.ui, + res = E5MessageBox.yesNo( + self.ui, self.trUtf8("Application Diagram"), self.trUtf8("""Include module names?"""), yesDefault=True) @@ -4428,9 +4511,11 @@ """ pkglist = os.path.join(self.ppath, "PKGLIST") if os.path.exists(pkglist): - res = E5MessageBox.yesNo(self.ui, + res = E5MessageBox.yesNo( + self.ui, self.trUtf8("Create Package List"), - self.trUtf8("<p>The file <b>PKGLIST</b> already" + self.trUtf8( + "<p>The file <b>PKGLIST</b> already" " exists.</p><p>Overwrite it?</p>"), icon=E5MessageBox.Warning) if not res: @@ -4444,8 +4529,9 @@ lst = [] for entry in lst_: if os.path.isdir(self.getAbsolutePath(entry)): - lst.extend([self.getRelativePath(p) for p in - Utilities.direntries(self.getAbsolutePath(entry), True)]) + lst.extend( + [self.getRelativePath(p) for p in + Utilities.direntries(self.getAbsolutePath(entry), True)]) continue else: lst.append(entry) @@ -4465,7 +4551,8 @@ pkglistFile.write("\n") # ensure the file ends with an empty line pkglistFile.close() except IOError as why: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Create Package List"), self.trUtf8( """<p>The file <b>PKGLIST</b> could not be created.</p>""" @@ -4483,7 +4570,8 @@ """ pkglist = os.path.join(self.ppath, "PKGLIST") if not os.path.exists(pkglist): - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Create Plugin Archive"), self.trUtf8("""<p>The file <b>PKGLIST</b> does not exist. """ """Aborting...</p>""")) @@ -4491,7 +4579,8 @@ if len(self.pdata["MAINSCRIPT"]) == 0 or \ len(self.pdata["MAINSCRIPT"][0]) == 0: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Create Plugin Archive"), self.trUtf8( """The project does not have a main script defined. """ @@ -4504,7 +4593,8 @@ pkglistFile.close() names = sorted(names.splitlines()) except IOError as why: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Create Plugin Archive"), self.trUtf8( """<p>The file <b>PKGLIST</b> could not be read.</p>""" @@ -4516,7 +4606,8 @@ try: archiveFile = zipfile.ZipFile(archive, "w") except IOError as why: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Create Plugin Archive"), self.trUtf8( """<p>The eric5 plugin archive file <b>{0}</b> could """ @@ -4541,7 +4632,8 @@ os.path.join(self.ppath, self.pdata["MAINSCRIPT"][0])) except OSError as why: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Create Plugin Archive"), self.trUtf8( """<p>The file <b>{0}</b> could not be stored """ @@ -4563,7 +4655,8 @@ """created successfully.</p>""")\ .format(os.path.basename(archive))) else: - E5MessageBox.information(self.ui, + E5MessageBox.information( + self.ui, self.trUtf8("Create Plugin Archive"), self.trUtf8( """<p>The eric5 plugin archive file <b>{0}</b> was """ @@ -4607,7 +4700,8 @@ sourcelines, encoding = Utilities.readEncodedFile(filename) sourcelines = sourcelines.splitlines(True) except (IOError, UnicodeError) as why: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Create Plugin Archive"), self.trUtf8("""<p>The plugin file <b>{0}</b> could """ """not be read.</p>""" @@ -4622,8 +4716,9 @@ datestr = time.strftime("%Y%m%d") lineend = sourcelines[lineno]\ .replace(sourcelines[lineno].rstrip(), "") - sversion = "{0}-snapshot-{1}".format(sourcelines[lineno]\ - .replace("version = ", "").strip()[1:-1], + sversion = "{0}-snapshot-{1}".format( + sourcelines[lineno].replace("version = ", "") + .strip()[1:-1], datestr) sourcelines[lineno] = '{0} + "-snapshot-{1}"{2}'.format( sourcelines[lineno].rstrip(), datestr, lineend) @@ -4646,7 +4741,8 @@ sourcelines = Utilities.readEncodedFile(filename)[0] sourcelines = sourcelines.splitlines(True) except (IOError, UnicodeError) as why: - E5MessageBox.critical(self.ui, + E5MessageBox.critical( + self.ui, self.trUtf8("Create Plugin Archive"), self.trUtf8( """<p>The plugin file <b>{0}</b> could """