Tue, 24 Sep 2019 18:46:24 +0200
Continued to resolve code style issue M841.
--- a/eric6/Preferences/ConfigurationDialog.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationDialog.py Tue Sep 24 18:46:24 2019 +0200 @@ -13,9 +13,11 @@ from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QMetaObject, QRect from PyQt5.QtGui import QPixmap -from PyQt5.QtWidgets import QSizePolicy, QSpacerItem, QWidget, QTreeWidget, \ - QStackedWidget, QDialog, QSplitter, QScrollArea, QApplication, \ - QDialogButtonBox, QFrame, QVBoxLayout, QTreeWidgetItem, QLabel +from PyQt5.QtWidgets import ( + QSizePolicy, QSpacerItem, QWidget, QTreeWidget, QStackedWidget, QDialog, + QSplitter, QScrollArea, QApplication, QDialogButtonBox, QFrame, + QVBoxLayout, QTreeWidgetItem, QLabel +) from E5Gui.E5Application import e5App from E5Gui.E5LineEdit import E5ClearableLineEdit @@ -575,8 +577,10 @@ QDialogButtonBox.Apply | QDialogButtonBox.Cancel | QDialogButtonBox.Ok | QDialogButtonBox.Reset) self.buttonBox.setObjectName("buttonBox") - if not self.fromEric and \ - self.displayMode == ConfigurationWidget.DefaultMode: + if ( + not self.fromEric and + self.displayMode == ConfigurationWidget.DefaultMode + ): self.buttonBox.button(QDialogButtonBox.Apply).hide() self.buttonBox.button(QDialogButtonBox.Apply).setEnabled(False) self.buttonBox.button(QDialogButtonBox.Reset).setEnabled(False) @@ -619,8 +623,11 @@ for index in range(parent.childCount()): itm = parent.child(index) if itm.childCount() > 0: - enable = self.__searchChildItems(itm, text) or \ - text == "" or text in itm.text(0).lower() + enable = ( + self.__searchChildItems(itm, text) or + text == "" or + text in itm.text(0).lower() + ) else: enable = text == "" or text in itm.text(0).lower() if enable: @@ -634,8 +641,9 @@ Private method to initialize the dictionary of preferences lexers. """ import QScintilla.Lexers - from .PreferencesLexer import PreferencesLexer, \ - PreferencesLexerLanguageError + from .PreferencesLexer import ( + PreferencesLexer, PreferencesLexerLanguageError + ) self.lexers = {} for language in QScintilla.Lexers.getSupportedLanguages(): @@ -880,8 +888,10 @@ @return flag indicating the use of QtWebEngine @rtype bool """ - return self.__webEngine or \ + return ( + self.__webEngine or self.displayMode == ConfigurationWidget.WebBrowserMode + ) class ConfigurationDialog(QDialog):
--- a/eric6/Preferences/ConfigurationPages/DebuggerGeneralPage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/DebuggerGeneralPage.py Tue Sep 24 18:46:24 2019 +0200 @@ -66,8 +66,10 @@ addressEntries = networkInterface.addressEntries() if len(addressEntries) > 0: for addressEntry in addressEntries: - if ":" in addressEntry.ip().toString() and \ - not socket.has_ipv6: + if ( + ":" in addressEntry.ip().toString() and + not socket.has_ipv6 + ): continue # IPv6 not supported by Python interfaces.append( "{0} ({1})".format( @@ -88,8 +90,10 @@ self.selectedInterfaceButton.setChecked(True) index = -1 for i in range(len(interfaces)): - if QRegExp(".*{0}.*".format(interface))\ - .exactMatch(interfaces[i]): + if ( + QRegExp(".*{0}.*".format(interface)) + .exactMatch(interfaces[i]) + ): index = i break self.interfacesCombo.setCurrentIndex(index) @@ -271,8 +275,9 @@ self.tr("Enter the IP address of an allowed host"), QLineEdit.Normal) if ok and allowedHost: - if QHostAddress(allowedHost).protocol() in \ - [QAbstractSocket.IPv4Protocol, QAbstractSocket.IPv6Protocol]: + if QHostAddress(allowedHost).protocol() in [ + QAbstractSocket.IPv4Protocol, QAbstractSocket.IPv6Protocol + ]: self.allowedHostsList.addItem(allowedHost) else: E5MessageBox.critical( @@ -304,8 +309,9 @@ QLineEdit.Normal, allowedHost) if ok and allowedHost: - if QHostAddress(allowedHost).protocol() in \ - [QAbstractSocket.IPv4Protocol, QAbstractSocket.IPv6Protocol]: + if QHostAddress(allowedHost).protocol() in [ + QAbstractSocket.IPv4Protocol, QAbstractSocket.IPv6Protocol + ]: self.allowedHostsList.currentItem().setText(allowedHost) else: E5MessageBox.critical(
--- a/eric6/Preferences/ConfigurationPages/EditorAPIsPage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/EditorAPIsPage.py Tue Sep 24 18:46:24 2019 +0200 @@ -149,9 +149,10 @@ """ Private slot to fill the list of API files. """ - self.apis[self.__apiKey(self.__currentApiLanguage, - self.__currentApiProjectType)] = \ - self.__editorGetApisFromApiList() + self.apis[ + self.__apiKey(self.__currentApiLanguage, + self.__currentApiProjectType) + ] = self.__editorGetApisFromApiList() self.__currentApiLanguage = self.apiLanguageComboBox.currentText() self.__currentApiProjectType = self.projectTypeComboBox.itemData(
--- a/eric6/Preferences/ConfigurationPages/EditorAutocompletionQScintillaPage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/EditorAutocompletionQScintillaPage.py Tue Sep 24 18:46:24 2019 +0200 @@ -11,8 +11,9 @@ from PyQt5.Qsci import QsciScintilla from .ConfigurationPageBase import ConfigurationPageBase -from .Ui_EditorAutocompletionQScintillaPage import \ +from .Ui_EditorAutocompletionQScintillaPage import ( Ui_EditorAutocompletionQScintillaPage +) import Preferences
--- a/eric6/Preferences/ConfigurationPages/EditorFilePage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/EditorFilePage.py Tue Sep 24 18:46:24 2019 +0200 @@ -34,10 +34,10 @@ self.setObjectName("EditorFilePage") self.__showsOpenFilters = True - self.openFileFilters = \ - Preferences.getEditor("AdditionalOpenFilters")[:] - self.saveFileFilters = \ - Preferences.getEditor("AdditionalSaveFilters")[:] + self.openFileFilters = Preferences.getEditor( + "AdditionalOpenFilters")[:] + self.saveFileFilters = Preferences.getEditor( + "AdditionalSaveFilters")[:] self.fileFiltersList.addItems(self.openFileFilters) self.__setDefaultFiltersLists() @@ -236,8 +236,10 @@ @param fileFilter file filter pattern to check (string) @return flag indicating validity (boolean) """ - if not self.__showsOpenFilters and \ - fileFilter.count("*") != 1: + if ( + not self.__showsOpenFilters and + fileFilter.count("*") != 1 + ): E5MessageBox.critical( self, self.tr("Add File Filter"),
--- a/eric6/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py Tue Sep 24 18:46:24 2019 +0200 @@ -10,8 +10,9 @@ from PyQt5.QtCore import pyqtSlot, Qt, QFileInfo, QFile, QIODevice from PyQt5.QtGui import QPalette, QFont -from PyQt5.QtWidgets import QColorDialog, QFontDialog, QInputDialog, QMenu, \ - QTreeWidgetItem, QDialog +from PyQt5.QtWidgets import ( + QColorDialog, QFontDialog, QInputDialog, QMenu, QTreeWidgetItem, QDialog +) from .ConfigurationPageBase import ConfigurationPageBase from .Ui_EditorHighlightingStylesPage import Ui_EditorHighlightingStylesPage
--- a/eric6/Preferences/ConfigurationPages/EditorKeywordsPage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/EditorKeywordsPage.py Tue Sep 24 18:46:24 2019 +0200 @@ -153,8 +153,9 @@ if self.currentLanguage == language and self.currentSet == kwSet: return - self.__keywords[self.currentLanguage]["Sets"][self.currentSet] = \ + self.__keywords[self.currentLanguage]["Sets"][self.currentSet] = ( self.keywordsEdit.toPlainText() + ) self.currentLanguage = language self.currentSet = kwSet @@ -179,8 +180,9 @@ if ok: language = self.languageCombo.currentText() kwSet = self.setSpinBox.value() - self.__keywords[language]["Sets"][kwSet] = \ + self.__keywords[language]["Sets"][kwSet] = ( self.__keywords[language]["DefaultSets"][kwSet] + ) self.keywordsEdit.setPlainText( self.__keywords[language]["Sets"][kwSet]) @@ -198,8 +200,9 @@ if ok: language = self.languageCombo.currentText() kwSet = self.setSpinBox.value() - self.__keywords[language]["Sets"] = \ + self.__keywords[language]["Sets"] = ( self.__keywords[language]["DefaultSets"][:] + ) self.keywordsEdit.setPlainText( self.__keywords[language]["Sets"][kwSet])
--- a/eric6/Preferences/ConfigurationPages/EditorStylesPage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/EditorStylesPage.py Tue Sep 24 18:46:24 2019 +0200 @@ -144,18 +144,18 @@ Preferences.getEditorColour) self.editorColours = {} - self.editorColours["AnnotationsWarningForeground"] = \ - QColor(Preferences.getEditorColour("AnnotationsWarningForeground")) - self.editorColours["AnnotationsWarningBackground"] = \ - QColor(Preferences.getEditorColour("AnnotationsWarningBackground")) - self.editorColours["AnnotationsErrorForeground"] = \ - QColor(Preferences.getEditorColour("AnnotationsErrorForeground")) - self.editorColours["AnnotationsErrorBackground"] = \ - QColor(Preferences.getEditorColour("AnnotationsErrorBackground")) - self.editorColours["AnnotationsStyleForeground"] = \ - QColor(Preferences.getEditorColour("AnnotationsStyleForeground")) - self.editorColours["AnnotationsStyleBackground"] = \ - QColor(Preferences.getEditorColour("AnnotationsStyleBackground")) + self.editorColours["AnnotationsWarningForeground"] = QColor( + Preferences.getEditorColour("AnnotationsWarningForeground")) + self.editorColours["AnnotationsWarningBackground"] = QColor( + Preferences.getEditorColour("AnnotationsWarningBackground")) + self.editorColours["AnnotationsErrorForeground"] = QColor( + Preferences.getEditorColour("AnnotationsErrorForeground")) + self.editorColours["AnnotationsErrorBackground"] = QColor( + Preferences.getEditorColour("AnnotationsErrorBackground")) + self.editorColours["AnnotationsStyleForeground"] = QColor( + Preferences.getEditorColour("AnnotationsStyleForeground")) + self.editorColours["AnnotationsStyleBackground"] = QColor( + Preferences.getEditorColour("AnnotationsStyleBackground")) self.eolCheckBox.setChecked(Preferences.getEditor("ShowEOL")) self.wrapModeComboBox.setCurrentIndex(self.wrapModeComboBox.findData(
--- a/eric6/Preferences/ConfigurationPages/EmailPage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/EmailPage.py Tue Sep 24 18:46:24 2019 +0200 @@ -311,8 +311,9 @@ try: import E5Network.E5GoogleMail # __IGNORE_WARNING__ - from E5Network.E5GoogleMailHelpers import \ + from E5Network.E5GoogleMailHelpers import ( isClientSecretFileAvailable + ) self.googleInstallButton.hide() if not isClientSecretFileAvailable():
--- a/eric6/Preferences/ConfigurationPages/InterfacePage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/InterfacePage.py Tue Sep 24 18:46:24 2019 +0200 @@ -140,8 +140,7 @@ # save the language settings uiLanguageIndex = self.languageComboBox.currentIndex() if uiLanguageIndex: - uiLanguage = \ - self.languageComboBox.itemData(uiLanguageIndex) + uiLanguage = self.languageComboBox.itemData(uiLanguageIndex) else: uiLanguage = None Preferences.setUILanguage(uiLanguage) @@ -217,20 +216,24 @@ """ self.languageComboBox.clear() - fnlist = glob.glob("eric6_*.qm") + \ + fnlist = ( + glob.glob("eric6_*.qm") + glob.glob(os.path.join( - getConfig('ericTranslationsDir'), "eric6_*.qm")) + \ + getConfig('ericTranslationsDir'), "eric6_*.qm")) + glob.glob(os.path.join(Utilities.getConfigDir(), "eric6_*.qm")) + ) locales = {} for fn in fnlist: locale = os.path.basename(fn)[6:-3] if locale not in locales: translator = QTranslator() translator.load(fn) - locales[locale] = translator.translate( - "InterfacePage", "English", - "Translate this with your language") + \ + locales[locale] = ( + translator.translate( + "InterfacePage", "English", + "Translate this with your language") + " ({0})".format(locale) + ) localeList = sorted(list(locales.keys())) try: uiLanguage = Preferences.getUILanguage()
--- a/eric6/Preferences/ConfigurationPages/MasterPasswordEntryDialog.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/MasterPasswordEntryDialog.py Tue Sep 24 18:46:24 2019 +0200 @@ -54,16 +54,18 @@ enable = False error = error or self.tr("New password must not be empty.") - if self.newPasswordEdit.text() != "" and \ - self.newPasswordEdit.text() != self.newPasswordAgainEdit.text(): + if ( + self.newPasswordEdit.text() != "" and + self.newPasswordEdit.text() != self.newPasswordAgainEdit.text() + ): enable = False error = error or self.tr("Repeated password is wrong.") if self.currentPasswordEdit.isEnabled(): if self.newPasswordEdit.text() == self.currentPasswordEdit.text(): enable = False - error = error or \ - self.tr("Old and new password must not be the same.") + error = error or self.tr( + "Old and new password must not be the same.") self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) self.errorLabel.setText(error)
--- a/eric6/Preferences/ConfigurationPages/PrinterPage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/PrinterPage.py Tue Sep 24 18:46:24 2019 +0200 @@ -94,8 +94,8 @@ """ Private method used to select the font for the page header. """ - self.printheaderFont = \ - self.selectFont(self.printheaderFontSample, self.printheaderFont) + self.printheaderFont = self.selectFont(self.printheaderFontSample, + self.printheaderFont) def polishPage(self): """
--- a/eric6/Preferences/ConfigurationPages/ProjectBrowserPage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/ProjectBrowserPage.py Tue Sep 24 18:46:24 2019 +0200 @@ -40,8 +40,9 @@ for projectType in sorted(projectTypes.keys()): self.projectTypeCombo.addItem(projectTypes[projectType], projectType) - self.__projectBrowserFlags[projectType] = \ + self.__projectBrowserFlags[projectType] = ( Preferences.getProjectBrowserFlags(projectType) + ) except KeyError: self.pbGroup.setEnabled(False) @@ -90,9 +91,11 @@ @param projectType type of the selected project (string) """ - from Project.ProjectBrowserFlags import SourcesBrowserFlag, \ - FormsBrowserFlag, ResourcesBrowserFlag, TranslationsBrowserFlag, \ - InterfacesBrowserFlag, OthersBrowserFlag, ProtocolsBrowserFlag + from Project.ProjectBrowserFlags import ( + SourcesBrowserFlag, FormsBrowserFlag, ResourcesBrowserFlag, + TranslationsBrowserFlag, InterfacesBrowserFlag, OthersBrowserFlag, + ProtocolsBrowserFlag + ) flags = 0 if self.sourcesBrowserCheckBox.isChecked(): @@ -119,9 +122,11 @@ @param projectType type of the selected project (string) """ - from Project.ProjectBrowserFlags import SourcesBrowserFlag, \ - FormsBrowserFlag, ResourcesBrowserFlag, TranslationsBrowserFlag, \ - InterfacesBrowserFlag, OthersBrowserFlag, ProtocolsBrowserFlag + from Project.ProjectBrowserFlags import ( + SourcesBrowserFlag, FormsBrowserFlag, ResourcesBrowserFlag, + TranslationsBrowserFlag, InterfacesBrowserFlag, OthersBrowserFlag, + ProtocolsBrowserFlag + ) flags = self.__projectBrowserFlags[projectType]
--- a/eric6/Preferences/ConfigurationPages/SecurityPage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/SecurityPage.py Tue Sep 24 18:46:24 2019 +0200 @@ -75,8 +75,10 @@ "UseMasterPassword", self.masterPasswordCheckBox.isChecked()) - if self.__oldUseMasterPassword != \ - self.masterPasswordCheckBox.isChecked(): + if ( + self.__oldUseMasterPassword != + self.masterPasswordCheckBox.isChecked() + ): self.__configDlg.masterPasswordChanged.emit("", self.__newPassword) @pyqtSlot(bool) @@ -114,8 +116,10 @@ "MasterPassword", dlg.getMasterPassword()) - if self.__oldUseMasterPassword != \ - self.masterPasswordCheckBox.isChecked(): + if ( + self.__oldUseMasterPassword != + self.masterPasswordCheckBox.isChecked() + ): # the user is about to change the use of a master password # just save the changed password self.__newPassword = dlg.getMasterPassword()
--- a/eric6/Preferences/ConfigurationPages/ViewmanagerPage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/ViewmanagerPage.py Tue Sep 24 18:46:24 2019 +0200 @@ -32,8 +32,8 @@ # set initial values self.pluginManager = e5App().getObject("PluginManager") - self.viewmanagers = \ - self.pluginManager.getPluginDisplayStrings("viewmanager") + self.viewmanagers = self.pluginManager.getPluginDisplayStrings( + "viewmanager") self.windowComboBox.clear() currentVm = Preferences.getViewManager() @@ -80,10 +80,10 @@ @param index index of selected workspace view type (integer) """ - workspace = \ - self.windowComboBox.itemData(self.windowComboBox.currentIndex()) - pixmap = \ - self.pluginManager.getPluginPreviewPixmap("viewmanager", workspace) + workspace = self.windowComboBox.itemData( + self.windowComboBox.currentIndex()) + pixmap = self.pluginManager.getPluginPreviewPixmap( + "viewmanager", workspace) self.previewPixmap.setPixmap(pixmap) self.tabViewGroupBox.setEnabled(workspace == "tabview")
--- a/eric6/Preferences/ConfigurationPages/WebBrowserFlashCookieManagerPage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/WebBrowserFlashCookieManagerPage.py Tue Sep 24 18:46:24 2019 +0200 @@ -11,8 +11,9 @@ from E5Gui.E5PathPicker import E5PathPickerModes from .ConfigurationPageBase import ConfigurationPageBase -from .Ui_WebBrowserFlashCookieManagerPage import \ +from .Ui_WebBrowserFlashCookieManagerPage import ( Ui_WebBrowserFlashCookieManagerPage +) import Preferences
--- a/eric6/Preferences/ConfigurationPages/WebBrowserPage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/WebBrowserPage.py Tue Sep 24 18:46:24 2019 +0200 @@ -178,8 +178,9 @@ self.languageCombo.setCurrentIndex(index) if self.__browserWindow: - for engineName in self.__browserWindow.imageSearchEngine()\ - .searchEngineNames(): + for engineName in ( + self.__browserWindow.imageSearchEngine().searchEngineNames() + ): self.imageSearchComboBox.addItem( UI.PixmapCache.getIcon( "{0}.png".format(engineName.lower())), @@ -474,8 +475,9 @@ """ Private slot to edit the referer whitelist. """ - from WebBrowser.Network.SendRefererWhitelistDialog import \ + from WebBrowser.Network.SendRefererWhitelistDialog import ( SendRefererWhitelistDialog + ) SendRefererWhitelistDialog(self).exec_()
--- a/eric6/Preferences/ConfigurationPages/WebBrowserSpellCheckingPage.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ConfigurationPages/WebBrowserSpellCheckingPage.py Tue Sep 24 18:46:24 2019 +0200 @@ -10,8 +10,9 @@ import os -from PyQt5.QtCore import pyqtSlot, Qt, QCoreApplication, QDir, QLibraryInfo, \ - QLocale +from PyQt5.QtCore import ( + pyqtSlot, Qt, QCoreApplication, QDir, QLibraryInfo, QLocale +) from PyQt5.QtWidgets import QListWidgetItem from .ConfigurationPageBase import ConfigurationPageBase @@ -172,8 +173,9 @@ """ Private slot to manage spell checking dictionaries. """ - from WebBrowser.SpellCheck.ManageDictionariesDialog import \ + from WebBrowser.SpellCheck.ManageDictionariesDialog import ( ManageDictionariesDialog + ) dlg = ManageDictionariesDialog(self.__writeableDirectories, self) dlg.exec_()
--- a/eric6/Preferences/MouseClickDialog.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/MouseClickDialog.py Tue Sep 24 18:46:24 2019 +0200 @@ -82,8 +82,10 @@ @return flag indicating a handled event @rtype bool """ - if event.type() == QEvent.MouseButtonRelease and \ - watched == self.clickEdit: + if ( + event.type() == QEvent.MouseButtonRelease and + watched == self.clickEdit + ): self.__modifiers = int(event.modifiers()) self.__button = int(event.button()) self.__showClickText()
--- a/eric6/Preferences/ProgramsDialog.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ProgramsDialog.py Tue Sep 24 18:46:24 2019 +0200 @@ -14,8 +14,9 @@ from PyQt5.QtCore import pyqtSlot, Qt, QProcess from PyQt5.QtGui import QCursor -from PyQt5.QtWidgets import QApplication, QTreeWidgetItem, QHeaderView, \ - QDialog, QDialogButtonBox +from PyQt5.QtWidgets import ( + QApplication, QTreeWidgetItem, QHeaderView, QDialog, QDialogButtonBox +) from E5Gui.E5Application import e5App @@ -82,9 +83,11 @@ # 1. do the Qt5 programs # 1a. Translation Converter - exe = Utilities.isWindowsPlatform() and \ - "{0}.exe".format(Utilities.generateQtToolName("lrelease")) or \ + exe = ( + Utilities.isWindowsPlatform() and + "{0}.exe".format(Utilities.generateQtToolName("lrelease")) or Utilities.generateQtToolName("lrelease") + ) exe = os.path.join(Utilities.getQtBinariesPath(), exe) version = self.__createProgramEntry( self.tr("Translation Converter (Qt)"), exe, '-version', @@ -363,10 +366,12 @@ else: exe = Utilities.getExecutablePath(exe) if exe: - if versionCommand and \ - (versionStartsWith != "" or - (versionRe is not None and versionRe != "")) and \ - versionPosition: + if ( + versionCommand and + (versionStartsWith != "" or + (versionRe is not None and versionRe != "")) and + versionPosition + ): proc = QProcess() proc.setProcessChannelMode(QProcess.MergedChannels) if exeModule: @@ -379,10 +384,13 @@ output = str(proc.readAllStandardOutput(), Preferences.getSystem("IOEncoding"), 'replace') - if exeModule and exeModule[0] == "-m" and \ + if ( + exeModule and + exeModule[0] == "-m" and ("ImportError:" in output or "ModuleNotFoundError:" in output or - proc.exitCode() != 0): + proc.exitCode() != 0) + ): version = self.tr("(module not found)") else: if versionRe is None:
--- a/eric6/Preferences/ShortcutsDialog.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ShortcutsDialog.py Tue Sep 24 18:46:24 2019 +0200 @@ -136,8 +136,9 @@ self.__generateShortcutItem(self.uiItem, act) self.wizardsItem = self.__generateCategoryItem(self.tr("Wizards")) - for act in e5App().getObject("UserInterface")\ - .getActions('wizards'): + for act in ( + e5App().getObject("UserInterface").getActions('wizards') + ): self.__generateShortcutItem(self.wizardsItem, act) self.debugItem = self.__generateCategoryItem(self.tr("Debug")) @@ -242,10 +243,12 @@ """ if column != 0: keystr = itm.text(column).title() - if not itm.data(0, self.noCheckRole) and \ - not self.__checkShortcut(QKeySequence(keystr), - itm.data(0, self.objectTypeRole), - itm.parent()): + if ( + not itm.data(0, self.noCheckRole) and + not self.__checkShortcut(QKeySequence(keystr), + itm.data(0, self.objectTypeRole), + itm.parent()) + ): itm.setText(column, "") else: itm.setText(column, keystr) @@ -264,11 +267,13 @@ be performed (boolean) @param objectType type of the object (string). """ - if not noCheck and \ - (not self.__checkShortcut( - keysequence, objectType, self.__editTopItem) or - not self.__checkShortcut( - altKeysequence, objectType, self.__editTopItem)): + if ( + not noCheck and + (not self.__checkShortcut( + keysequence, objectType, self.__editTopItem) or + not self.__checkShortcut( + altKeysequence, objectType, self.__editTopItem)) + ): return self.shortcutsList.currentItem().setText(1, keysequence.toString()) @@ -304,9 +309,11 @@ # 2. check object type itmObjectType = itm.data(0, self.objectTypeRole) - if itmObjectType and \ - itmObjectType == objectType and \ - topItem != origTopItem: + if ( + itmObjectType and + itmObjectType == objectType and + topItem != origTopItem + ): continue # 3. check key name @@ -460,12 +467,14 @@ childHiddenCount = 0 for index in range(topItem.childCount()): itm = topItem.child(index) - if (self.actionButton.isChecked() and - not QRegExp(txt, Qt.CaseInsensitive).indexIn( - itm.text(0)) > -1) or \ - (self.shortcutButton.isChecked() and - not txt.lower() in itm.text(1).lower() and - not txt.lower() in itm.text(2).lower()): + if ( + (self.actionButton.isChecked() and + not QRegExp(txt, Qt.CaseInsensitive).indexIn( + itm.text(0)) > -1) or + (self.shortcutButton.isChecked() and + not txt.lower() in itm.text(1).lower() and + not txt.lower() in itm.text(2).lower()) + ): itm.setHidden(True) childHiddenCount += 1 else:
--- a/eric6/Preferences/SubstyleDefinitionDialog.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/SubstyleDefinitionDialog.py Tue Sep 24 18:46:24 2019 +0200 @@ -99,8 +99,10 @@ """ Private slot to set the dialog contents to default values. """ - filled = bool(self.descriptionEdit.text().strip()) or \ + filled = ( + bool(self.descriptionEdit.text().strip()) or bool(self.wordsEdit.toPlainText().strip()) + ) if filled: ok = E5MessageBox.yesNo( self,
--- a/eric6/Preferences/ToolConfigurationDialog.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/ToolConfigurationDialog.py Tue Sep 24 18:46:24 2019 +0200 @@ -327,9 +327,11 @@ Private slot to perform actions when a tool entry was changed. """ row = self.toolsList.currentRow() - if row >= 0 and \ - row < len(self.toollist) and \ - self.toollist[row]['menutext'] != '--': + if ( + row >= 0 and + row < len(self.toollist) and + self.toollist[row]['menutext'] != '--' + ): self.changeButton.setEnabled(True) def on_menuEdit_textChanged(self, text):
--- a/eric6/Preferences/__init__.py Tue Sep 24 18:45:33 2019 +0200 +++ b/eric6/Preferences/__init__.py Tue Sep 24 18:46:24 2019 +0200 @@ -23,8 +23,10 @@ import json import sys -from PyQt5.QtCore import QDir, QPoint, QLocale, QSettings, QFileInfo, \ - QCoreApplication, QByteArray, QSize, QUrl, Qt, QLibraryInfo, QDateTime +from PyQt5.QtCore import ( + QDir, QPoint, QLocale, QSettings, QFileInfo, QCoreApplication, QByteArray, + QSize, QUrl, Qt, QLibraryInfo, QDateTime +) from PyQt5.QtGui import QColor, QFont, QPalette from PyQt5.QtWidgets import QApplication try: @@ -39,12 +41,15 @@ import Globals -from Project.ProjectBrowserFlags import SourcesBrowserFlag, FormsBrowserFlag, \ - ResourcesBrowserFlag, TranslationsBrowserFlag, InterfacesBrowserFlag, \ - OthersBrowserFlag, ProtocolsBrowserFlag, AllBrowsersFlag +from Project.ProjectBrowserFlags import ( + SourcesBrowserFlag, FormsBrowserFlag, ResourcesBrowserFlag, + TranslationsBrowserFlag, InterfacesBrowserFlag, OthersBrowserFlag, + ProtocolsBrowserFlag, AllBrowsersFlag +) -from WebBrowser.FlashCookieManager.FlashCookieUtilities import \ +from WebBrowser.FlashCookieManager.FlashCookieUtilities import ( flashDataPathForOS +) from QScintilla.Shell import ShellHistoryStyle @@ -951,8 +956,8 @@ "SpellCheckEnabled": False, "SpellCheckLanguages": [], "SpellCheckDictionariesUrl": - "https://eric-ide.python-projects.org/qwebengine_dictionaries/" \ - "dictionaries.xml", + ("https://eric-ide.python-projects.org/qwebengine_dictionaries/" + "dictionaries.xml"), # Sync "SyncEnabled": False, "SyncBookmarks": True,