Sat, 21 Sep 2019 18:30:02 +0200
Continued to resolve code style issue M841.
--- a/eric6/Network/IRC/IrcChannelWidget.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/Network/IRC/IrcChannelWidget.py Sat Sep 21 18:30:02 2019 +0200 @@ -12,11 +12,14 @@ import re -from PyQt5.QtCore import pyqtSlot, pyqtSignal, QDateTime, QPoint, QFileInfo, \ - QTimer, QUrl, QCoreApplication +from PyQt5.QtCore import ( + pyqtSlot, pyqtSignal, QDateTime, QPoint, QFileInfo, QTimer, QUrl, + QCoreApplication +) from PyQt5.QtGui import QIcon, QPainter, QTextCursor, QDesktopServices -from PyQt5.QtWidgets import QWidget, QListWidgetItem, QMenu, QApplication, \ - QInputDialog, QLineEdit +from PyQt5.QtWidgets import ( + QWidget, QListWidgetItem, QMenu, QApplication, QInputDialog, QLineEdit +) from E5Gui import E5MessageBox, E5FileDialog from E5Gui.E5Application import e5App @@ -428,11 +431,15 @@ if cmd in ["MSG", "QUERY"]: cmd = "PRIVMSG" if len(msgList) > 1: - if msgList[1].strip().lower() in \ - self.__serviceNamesLower: - msg = "PRIVMSG " + \ - msgList[1].strip().lower() + \ + if ( + msgList[1].strip().lower() in + self.__serviceNamesLower + ): + msg = ( + "PRIVMSG " + + msgList[1].strip().lower() + " :" + " ".join(msgList[2:]) + ) else: msg = "PRIVMSG {0} :{1}".format( msgList[1], " ".join(msgList[2:])) @@ -681,8 +688,10 @@ self.__ui.showNotification( UI.PixmapCache.getPixmap("irc48.png"), self.tr("Channel Message"), msg) - elif Preferences.getIrc("NotifyNick") and \ - self.__userName.lower() in msg.lower(): + elif ( + Preferences.getIrc("NotifyNick") and + self.__userName.lower() in msg.lower() + ): self.__ui.showNotification( UI.PixmapCache.getPixmap("irc48.png"), self.tr("Nick mentioned"), msg) @@ -719,8 +728,10 @@ self.__name, match.group(2)) self.__addManagementMessage( IrcChannelWidget.JoinIndicator, msg) - if Preferences.getIrc("ShowNotifications") and \ - Preferences.getIrc("NotifyJoinPart"): + if ( + Preferences.getIrc("ShowNotifications") and + Preferences.getIrc("NotifyJoinPart") + ): self.__ui.showNotification( UI.PixmapCache.getPixmap("irc48.png"), self.tr("Join Channel"), msg) @@ -752,8 +763,10 @@ match.group(1), self.__name, match.group(3)) self.__addManagementMessage( IrcChannelWidget.LeaveIndicator, msg) - if Preferences.getIrc("ShowNotifications") and \ - Preferences.getIrc("NotifyJoinPart"): + if ( + Preferences.getIrc("ShowNotifications") and + Preferences.getIrc("NotifyJoinPart") + ): self.__ui.showNotification( UI.PixmapCache.getPixmap("irc48.png"), self.tr("Leave Channel"), nmsg) @@ -782,8 +795,10 @@ match.group(1), self.__name, ircFilter(match.group(2))) self.__addManagementMessage( IrcChannelWidget.MessageIndicator, msg) - if Preferences.getIrc("ShowNotifications") and \ - Preferences.getIrc("NotifyJoinPart"): + if ( + Preferences.getIrc("ShowNotifications") and + Preferences.getIrc("NotifyJoinPart") + ): self.__ui.showNotification( UI.PixmapCache.getPixmap("irc48.png"), self.tr("Quit"), msg) @@ -983,8 +998,8 @@ elif mode == "a": if isPlus: message = self.tr( - "{0} sets the channel mode to 'anonymous'.")\ - .format(nick) + "{0} sets the channel mode to 'anonymous'." + ).format(nick) else: message = self.tr( "{0} removes the 'anonymous' mode from the" @@ -1019,8 +1034,8 @@ elif mode == "i": if isPlus: message = self.tr( - "{0} sets the channel mode to 'invite only'.")\ - .format(nick) + "{0} sets the channel mode to 'invite only'." + ).format(nick) else: message = self.tr( "{0} removes the 'invite only' mode from the" @@ -1044,12 +1059,12 @@ elif mode == "m": if isPlus: message = self.tr( - "{0} sets the channel mode to 'moderated'.")\ - .format(nick) + "{0} sets the channel mode to 'moderated'." + ).format(nick) else: message = self.tr( - "{0} sets the channel mode to 'unmoderated'.")\ - .format(nick) + "{0} sets the channel mode to 'unmoderated'." + ).format(nick) elif mode == "n": if isPlus: message = self.tr( @@ -1062,40 +1077,40 @@ elif mode == "p": if isPlus: message = self.tr( - "{0} sets the channel mode to 'private'.")\ - .format(nick) + "{0} sets the channel mode to 'private'." + ).format(nick) else: message = self.tr( - "{0} sets the channel mode to 'public'.")\ - .format(nick) + "{0} sets the channel mode to 'public'." + ).format(nick) elif mode == "q": if isPlus: message = self.tr( - "{0} sets the channel mode to 'quiet'.")\ - .format(nick) + "{0} sets the channel mode to 'quiet'." + ).format(nick) else: message = self.tr( - "{0} removes the 'quiet' mode from the channel.")\ - .format(nick) + "{0} removes the 'quiet' mode from the channel." + ).format(nick) elif mode == "r": continue elif mode == "s": if isPlus: message = self.tr( - "{0} sets the channel mode to 'secret'.")\ - .format(nick) + "{0} sets the channel mode to 'secret'." + ).format(nick) else: message = self.tr( - "{0} sets the channel mode to 'visible'.")\ - .format(nick) + "{0} sets the channel mode to 'visible'." + ).format(nick) elif mode == "t": if isPlus: message = self.tr( "{0} switches on 'topic protection'.").format(nick) else: message = self.tr( - "{0} switches off 'topic protection'.")\ - .format(nick) + "{0} switches off 'topic protection'." + ).format(nick) elif mode == "I": if isPlus: message = self.tr( @@ -1271,9 +1286,11 @@ @param message message to be appended (string) """ - if self.__hidden and \ - self.__markerLine == "" and \ - Preferences.getIrc("MarkPositionWhenHidden"): + if ( + self.__hidden and + self.__markerLine == "" and + Preferences.getIrc("MarkPositionWhenHidden") + ): self.setMarkerLine() self.messages.append(message) @@ -1282,11 +1299,12 @@ Public method to draw a line to mark the current position. """ self.unsetMarkerLine() - self.__markerLine = \ - '<span style=" color:{0}; background-color:{1};">{2}</span>'\ + self.__markerLine = ( + '<span style=" color:{0}; background-color:{1};">{2}</span>' .format(Preferences.getIrc("MarkerLineForegroundColour"), Preferences.getIrc("MarkerLineBackgroundColour"), self.tr('--- New From Here ---')) + ) self.messages.append(self.__markerLine) def unsetMarkerLine(self): @@ -1398,29 +1416,24 @@ Private slot to initialize the context menu of the messages pane. """ self.__messagesMenu = QMenu(self) - self.__copyMessagesAct = \ - self.__messagesMenu.addAction( - UI.PixmapCache.getIcon("editCopy.png"), - self.tr("Copy"), self.__copyMessages) + self.__copyMessagesAct = self.__messagesMenu.addAction( + UI.PixmapCache.getIcon("editCopy.png"), + self.tr("Copy"), self.__copyMessages) self.__messagesMenu.addSeparator() - self.__cutAllMessagesAct = \ - self.__messagesMenu.addAction( - UI.PixmapCache.getIcon("editCut.png"), - self.tr("Cut all"), self.__cutAllMessages) - self.__copyAllMessagesAct = \ - self.__messagesMenu.addAction( - UI.PixmapCache.getIcon("editCopy.png"), - self.tr("Copy all"), self.__copyAllMessages) + self.__cutAllMessagesAct = self.__messagesMenu.addAction( + UI.PixmapCache.getIcon("editCut.png"), + self.tr("Cut all"), self.__cutAllMessages) + self.__copyAllMessagesAct = self.__messagesMenu.addAction( + UI.PixmapCache.getIcon("editCopy.png"), + self.tr("Copy all"), self.__copyAllMessages) self.__messagesMenu.addSeparator() - self.__clearMessagesAct = \ - self.__messagesMenu.addAction( - UI.PixmapCache.getIcon("editDelete.png"), - self.tr("Clear"), self.__clearMessages) + self.__clearMessagesAct = self.__messagesMenu.addAction( + UI.PixmapCache.getIcon("editDelete.png"), + self.tr("Clear"), self.__clearMessages) self.__messagesMenu.addSeparator() - self.__saveMessagesAct = \ - self.__messagesMenu.addAction( - UI.PixmapCache.getIcon("fileSave.png"), - self.tr("Save"), self.__saveMessages) + self.__saveMessagesAct = self.__messagesMenu.addAction( + UI.PixmapCache.getIcon("fileSave.png"), + self.tr("Save"), self.__saveMessages) self.__messagesMenu.addSeparator() self.__setMarkerMessagesAct = self.__messagesMenu.addAction( self.tr("Mark Current Position"), self.setMarkerLine) @@ -1657,8 +1670,10 @@ # group(5) user flags # group(6) real name if match.group(1).lower() == self.__name.lower(): - away = self.tr(" (Away)") if match.group(5).startswith("G") \ - else "" + away = ( + self.tr(" (Away)") + if match.group(5).startswith("G") else "" + ) self.__addManagementMessage( self.tr("Who"), self.tr("{0} is {1}@{2} ({3}){4}").format( @@ -1711,8 +1726,10 @@ for channel in channelList: if channel.startswith(("*", "&")): adminChannels.append(channel[1:]) - elif channel.startswith(("!", "~")) and \ - self.__ircWidget.isChannelName(channel[1:]): + elif ( + channel.startswith(("!", "~")) and + self.__ircWidget.isChannelName(channel[1:]) + ): ownerChannels.append(channel[1:]) elif channel.startswith("@+"): opChannels.append(channel[2:])
--- a/eric6/Network/IRC/IrcIdentitiesEditDialog.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/Network/IRC/IrcIdentitiesEditDialog.py Sat Sep 21 18:30:02 2019 +0200 @@ -57,8 +57,9 @@ self.__currentIdentity = None identities = list(sorted(self.__manager.getIdentityNames())) - identities[identities.index(IrcIdentity.DefaultIdentityName)] = \ + identities[identities.index(IrcIdentity.DefaultIdentityName)] = ( IrcIdentity.DefaultIdentityDisplay + ) self.identitiesCombo.addItems(identities) if identityName == IrcIdentity.DefaultIdentityName: identityName = IrcIdentity.DefaultIdentityDisplay @@ -363,8 +364,10 @@ if self.nicknamesList.currentRow() == 0: self.nicknameUpButton.setEnabled(False) self.nicknameDownButton.setEnabled(True) - elif self.nicknamesList.currentRow() == \ - self.nicknamesList.count() - 1: + elif ( + self.nicknamesList.currentRow() == + self.nicknamesList.count() - 1 + ): self.nicknameUpButton.setEnabled(True) self.nicknameDownButton.setEnabled(False) else:
--- a/eric6/Network/IRC/IrcMessageEdit.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/Network/IRC/IrcMessageEdit.py Sat Sep 21 18:30:02 2019 +0200 @@ -89,8 +89,10 @@ @param txt text to be added to the history (string) """ # Only add the entry, if it is not the same as last time - if len(self.__historyList) == 1 or \ - (len(self.__historyList) > 1 and self.__historyList[1] != txt): + if ( + len(self.__historyList) == 1 or + (len(self.__historyList) > 1 and self.__historyList[1] != txt) + ): # Replace empty first entry and add new empty first entry self.__historyList[0] = txt self.__historyList.insert(0, "")
--- a/eric6/Network/IRC/IrcNetworkEditDialog.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/Network/IRC/IrcNetworkEditDialog.py Sat Sep 21 18:30:02 2019 +0200 @@ -106,8 +106,9 @@ from .IrcNetworkManager import IrcIdentity identities = list(sorted(self.__manager.getIdentityNames())) - identities[identities.index(IrcIdentity.DefaultIdentityName)] = \ + identities[identities.index(IrcIdentity.DefaultIdentityName)] = ( IrcIdentity.DefaultIdentityDisplay + ) self.identityCombo.addItems(identities) if currentIdentity == IrcIdentity.DefaultIdentityName: currentIdentity = IrcIdentity.DefaultIdentityDisplay
--- a/eric6/Network/IRC/IrcNetworkListDialog.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/Network/IRC/IrcNetworkListDialog.py Sat Sep 21 18:30:02 2019 +0200 @@ -81,8 +81,9 @@ identityName = network.getIdentityName() if identityName == IrcIdentity.DefaultIdentityName: identityName = IrcIdentity.DefaultIdentityDisplay - autoConnect = self.tr("Yes") if network.autoConnect() \ - else self.tr("No") + autoConnect = ( + self.tr("Yes") if network.autoConnect() else self.tr("No") + ) QTreeWidgetItem( itm,
--- a/eric6/Network/IRC/IrcNetworkManager.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/Network/IRC/IrcNetworkManager.py Sat Sep 21 18:30:02 2019 +0200 @@ -805,8 +805,7 @@ self.__settings.endGroup() - if not self.__identities or \ - not self.__networks: + if not self.__identities or not self.__networks: # data structures got corrupted; load defaults self.__loadDefaults() @@ -916,8 +915,10 @@ @param name name of the identity to delete (string) """ - if name in self.__identities and \ - name != IrcIdentity.DefaultIdentityName: + if ( + name in self.__identities and + name != IrcIdentity.DefaultIdentityName + ): del self.__identities[name] self.identityChanged()
--- a/eric6/Network/IRC/IrcNetworkWidget.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/Network/IRC/IrcNetworkWidget.py Sat Sep 21 18:30:02 2019 +0200 @@ -169,8 +169,9 @@ self.handleAwayCommand("") else: networkName = self.networkCombo.currentText() - identityName = self.__manager.getNetwork(networkName)\ - .getIdentityName() + identityName = ( + self.__manager.getNetwork(networkName).getIdentityName() + ) identity = self.__manager.getIdentity(identityName) if identity: awayMessage = identity.getAwayMessage() @@ -469,29 +470,24 @@ Private slot to initialize the context menu of the messages pane. """ self.__messagesMenu = QMenu(self) - self.__copyMessagesAct = \ - self.__messagesMenu.addAction( - UI.PixmapCache.getIcon("editCopy.png"), - self.tr("Copy"), self.__copyMessages) + self.__copyMessagesAct = self.__messagesMenu.addAction( + UI.PixmapCache.getIcon("editCopy.png"), + self.tr("Copy"), self.__copyMessages) self.__messagesMenu.addSeparator() - self.__cutAllMessagesAct = \ - self.__messagesMenu.addAction( - UI.PixmapCache.getIcon("editCut.png"), - self.tr("Cut all"), self.__cutAllMessages) - self.__copyAllMessagesAct = \ - self.__messagesMenu.addAction( - UI.PixmapCache.getIcon("editCopy.png"), - self.tr("Copy all"), self.__copyAllMessages) + self.__cutAllMessagesAct = self.__messagesMenu.addAction( + UI.PixmapCache.getIcon("editCut.png"), + self.tr("Cut all"), self.__cutAllMessages) + self.__copyAllMessagesAct = self.__messagesMenu.addAction( + UI.PixmapCache.getIcon("editCopy.png"), + self.tr("Copy all"), self.__copyAllMessages) self.__messagesMenu.addSeparator() - self.__clearMessagesAct = \ - self.__messagesMenu.addAction( - UI.PixmapCache.getIcon("editDelete.png"), - self.tr("Clear"), self.__clearMessages) + self.__clearMessagesAct = self.__messagesMenu.addAction( + UI.PixmapCache.getIcon("editDelete.png"), + self.tr("Clear"), self.__clearMessages) self.__messagesMenu.addSeparator() - self.__saveMessagesAct = \ - self.__messagesMenu.addAction( - UI.PixmapCache.getIcon("fileSave.png"), - self.tr("Save"), self.__saveMessages) + self.__saveMessagesAct = self.__messagesMenu.addAction( + UI.PixmapCache.getIcon("fileSave.png"), + self.tr("Save"), self.__saveMessages) self.on_messages_copyAvailable(False)
--- a/eric6/Network/IRC/IrcUtilities.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/Network/IRC/IrcUtilities.py Sat Sep 21 18:30:02 2019 +0200 @@ -111,11 +111,13 @@ else: if colors[0]: # foreground and background - tag = '<span style="background-color:{0};color={1}">'\ + tag = ( + '<span style="background-color:{0};color={1}">' .format(Preferences.getIrc( "IrcColor{0}".format(int(colors[0]))), Preferences.getIrc( "IrcColor{0}".format(int(colors[1])))) + ) else: # background only tag = '<span style="background-color:{0}">'.format(
--- a/eric6/Network/IRC/IrcWidget.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/Network/IRC/IrcWidget.py Sat Sep 21 18:30:02 2019 +0200 @@ -11,8 +11,9 @@ import re import logging -from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QByteArray, QTimer, \ - QDateTime +from PyQt5.QtCore import ( + pyqtSlot, pyqtSignal, Qt, QByteArray, QTimer, QDateTime +) from PyQt5.QtWidgets import QWidget, QToolButton, QLabel, QTabWidget from PyQt5.QtNetwork import QTcpSocket, QAbstractSocket try: @@ -796,8 +797,8 @@ parts = message.strip().split() message = self.tr( "Server {0} (Version {1}), User-Modes: {2}," - " Channel-Modes: {3}")\ - .format(parts[1], parts[2], parts[3], parts[4]) + " Channel-Modes: {3}" + ).format(parts[1], parts[2], parts[3], parts[4]) elif code == 265: parts = message.strip().split() message = self.tr(
--- a/eric6/PipInterface/Pip.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/PipInterface/Pip.py Sat Sep 21 18:30:02 2019 +0200 @@ -14,8 +14,9 @@ from PyQt5.QtCore import pyqtSlot, QObject, QProcess, QUrl, QCoreApplication from PyQt5.QtWidgets import QDialog -from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest, \ - QNetworkReply +from PyQt5.QtNetwork import ( + QNetworkAccessManager, QNetworkRequest, QNetworkReply +) from E5Gui import E5MessageBox from E5Gui.E5Application import e5App @@ -184,15 +185,18 @@ @rtype str """ if venvName == self.getProjectEnvironmentString(): - venvName = \ - e5App().getObject("Project").getDebugProperty("VIRTUALENV") + venvName = ( + e5App().getObject("Project") + .getDebugProperty("VIRTUALENV") + ) if not venvName: # fall back to interpreter used to run eric6 return sys.executable - interpreter = \ - e5App().getObject("VirtualEnvManager").getVirtualenvInterpreter( - venvName) + interpreter = ( + e5App().getObject("VirtualEnvManager") + .getVirtualenvInterpreter(venvName) + ) if not interpreter: E5MessageBox.critical( None, @@ -393,8 +397,7 @@ return if Preferences.getPip("PipSearchIndex"): - indexUrl = Preferences.getPip("PipSearchIndex") + \ - "/simple" + indexUrl = Preferences.getPip("PipSearchIndex") + "/simple" args = ["-m", "pip", "install", "--index-url", indexUrl] else: args = ["-m", "pip", "install"] @@ -419,8 +422,9 @@ """ res = False if packages and venvName: - from UI.DeleteFilesConfirmationDialog import \ + from UI.DeleteFilesConfirmationDialog import ( DeleteFilesConfirmationDialog + ) dlg = DeleteFilesConfirmationDialog( self.parent(), self.tr("Uninstall Packages"), @@ -459,8 +463,9 @@ except (OSError, IOError): return - from UI.DeleteFilesConfirmationDialog import \ + from UI.DeleteFilesConfirmationDialog import ( DeleteFilesConfirmationDialog + ) dlg = DeleteFilesConfirmationDialog( self.parent(), self.tr("Uninstall Packages"),
--- a/eric6/PipInterface/PipDialog.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/PipInterface/PipDialog.py Sat Sep 21 18:30:02 2019 +0200 @@ -8,8 +8,9 @@ """ -from PyQt5.QtCore import pyqtSlot, Qt, QCoreApplication, QTimer, \ - QProcess +from PyQt5.QtCore import ( + pyqtSlot, Qt, QCoreApplication, QTimer, QProcess +) from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QAbstractButton from E5Gui import E5MessageBox @@ -54,8 +55,10 @@ """ self.__processQueue = [] - if self.proc is not None and \ - self.proc.state() != QProcess.NotRunning: + if ( + self.proc is not None and + self.proc.state() != QProcess.NotRunning + ): self.proc.terminate() QTimer.singleShot(2000, self.proc.kill) self.proc.waitForFinished(3000) @@ -69,8 +72,10 @@ Private slot called when the process finished or the user pressed the button. """ - if self.proc is not None and \ - self.proc.state() != QProcess.NotRunning: + if ( + self.proc is not None and + self.proc.state() != QProcess.NotRunning + ): self.proc.terminate() QTimer.singleShot(2000, self.proc.kill) self.proc.waitForFinished(3000)
--- a/eric6/PipInterface/PipFreezeDialog.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/PipInterface/PipFreezeDialog.py Sat Sep 21 18:30:02 2019 +0200 @@ -11,8 +11,9 @@ import os from PyQt5.QtCore import pyqtSlot, Qt -from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QAbstractButton, \ - QApplication +from PyQt5.QtWidgets import ( + QDialog, QDialogButtonBox, QAbstractButton, QApplication +) from E5Gui import E5MessageBox, E5FileDialog from E5Gui.E5PathPicker import E5PathPickerModes
--- a/eric6/PipInterface/PipPackageDetailsDialog.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/PipInterface/PipPackageDetailsDialog.py Sat Sep 21 18:30:02 2019 +0200 @@ -9,8 +9,9 @@ from PyQt5.QtCore import Qt, QLocale -from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QTreeWidgetItem, \ - QLabel, QHeaderView +from PyQt5.QtWidgets import ( + QDialog, QDialogButtonBox, QTreeWidgetItem, QLabel, QHeaderView +) from .Ui_PipPackageDetailsDialog import Ui_PipPackageDetailsDialog @@ -176,8 +177,10 @@ elif text is None: text = "" if forUrl: - if not isinstance(text, str) or \ - not text.startswith(("http://", "https://", "ftp://")): + if ( + not isinstance(text, str) or + not text.startswith(("http://", "https://", "ftp://")) + ): # ignore if the schema is not one of the listed ones text = ""
--- a/eric6/PipInterface/PipPackagesWidget.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/PipInterface/PipPackagesWidget.py Sat Sep 21 18:30:02 2019 +0200 @@ -13,8 +13,10 @@ from PyQt5.QtCore import pyqtSlot, Qt, QEventLoop, QRegExp from PyQt5.QtGui import QCursor -from PyQt5.QtWidgets import QWidget, QToolButton, QApplication, QHeaderView, \ - QTreeWidgetItem, QInputDialog, QMenu, QDialog +from PyQt5.QtWidgets import ( + QWidget, QToolButton, QApplication, QHeaderView, QTreeWidgetItem, + QInputDialog, QMenu, QDialog +) from E5Gui.E5Application import e5App from E5Gui import E5MessageBox @@ -878,8 +880,9 @@ if self.__packageDetailsDialog is not None: self.__packageDetailsDialog.close() - self.__packageDetailsDialog = \ + self.__packageDetailsDialog = ( PipPackageDetailsDialog(packageData, self) + ) self.__packageDetailsDialog.show() else: E5MessageBox.warning(
--- a/eric6/PluginManager/PluginExceptions.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/PluginManager/PluginExceptions.py Sat Sep 21 18:30:02 2019 +0200 @@ -81,11 +81,10 @@ @param name name of the plugin module (string) """ - self._errorMessage = \ - QCoreApplication.translate( - "PluginError", - "Error loading plugin module: {0}")\ - .format(name) + self._errorMessage = QCoreApplication.translate( + "PluginError", + "Error loading plugin module: {0}" + ).format(name) class PluginActivationError(PluginError): @@ -99,11 +98,10 @@ @param name name of the plugin module (string) """ - self._errorMessage = \ - QCoreApplication.translate( - "PluginError", - "Error activating plugin module: {0}")\ - .format(name) + self._errorMessage = QCoreApplication.translate( + "PluginError", + "Error activating plugin module: {0}" + ).format(name) class PluginModuleFormatError(PluginError): @@ -117,11 +115,10 @@ @param name name of the plugin module (string) @param missing description of the missing element (string) """ - self._errorMessage = \ - QCoreApplication.translate( - "PluginError", - "The plugin module {0} is missing {1}.")\ - .format(name, missing) + self._errorMessage = QCoreApplication.translate( + "PluginError", + "The plugin module {0} is missing {1}." + ).format(name, missing) class PluginClassFormatError(PluginError): @@ -137,8 +134,7 @@ (string) @param missing description of the missing element (string) """ - self._errorMessage = \ - QCoreApplication.translate( - "PluginError", - "The plugin class {0} of module {1} is missing {2}.")\ - .format(class_, name, missing) + self._errorMessage = QCoreApplication.translate( + "PluginError", + "The plugin class {0} of module {1} is missing {2}." + ).format(class_, name, missing)
--- a/eric6/PluginManager/PluginInstallDialog.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/PluginManager/PluginInstallDialog.py Sat Sep 21 18:30:02 2019 +0200 @@ -20,8 +20,10 @@ import urlparse as parse # __IGNORE_WARNING__ from PyQt5.QtCore import pyqtSlot, Qt, QDir, QFileInfo -from PyQt5.QtWidgets import QWidget, QDialogButtonBox, QAbstractButton, \ - QApplication, QDialog, QVBoxLayout +from PyQt5.QtWidgets import ( + QWidget, QDialogButtonBox, QAbstractButton, QApplication, QDialog, + QVBoxLayout +) from E5Gui import E5FileDialog from E5Gui.E5MainWindow import E5MainWindow @@ -142,12 +144,14 @@ self.__cancelButton.show() msg = self.tr( - "Plugin ZIP-Archives:\n{0}\n\nDestination:\n{1} ({2})")\ - .format("\n".join(self.__createArchivesList()), - self.destinationCombo.currentText(), - self.destinationCombo.itemData( - self.destinationCombo.currentIndex()) - ) + "Plugin ZIP-Archives:\n{0}\n\nDestination:\n{1} ({2})" + ).format( + "\n".join(self.__createArchivesList()), + self.destinationCombo.currentText(), + self.destinationCombo.itemData( + self.destinationCombo.currentIndex() + ) + ) self.summaryEdit.setPlainText(msg) @pyqtSlot() @@ -268,27 +272,33 @@ # check, if the archive exists if not os.path.exists(archive): - return False, \ + return ( + False, self.tr( """<p>The archive file <b>{0}</b> does not exist. """ - """Aborting...</p>""").format(archive), \ + """Aborting...</p>""").format(archive), False + ) # check, if the archive is a valid zip file if not zipfile.is_zipfile(archive): - return False, \ + return ( + False, self.tr( """<p>The file <b>{0}</b> is not a valid plugin """ - """ZIP-archive. Aborting...</p>""").format(archive), \ + """ZIP-archive. Aborting...</p>""").format(archive), False + ) # check, if the destination is writeable if not os.access(destination, os.W_OK): - return False, \ + return ( + False, self.tr( """<p>The destination directory <b>{0}</b> is not """ - """writeable. Aborting...</p>""").format(destination), \ + """writeable. Aborting...</p>""").format(destination), False + ) zipFile = zipfile.ZipFile(archive, "r") @@ -303,11 +313,13 @@ break if not pluginFound: - return False, \ + return ( + False, self.tr( """<p>The file <b>{0}</b> is not a valid plugin """ - """ZIP-archive. Aborting...</p>""").format(archive), \ + """ZIP-archive. Aborting...</p>""").format(archive), False + ) # parse the plugin module's plugin header pluginSource = Utilities.decode(zipFile.read(pluginFileName))[0] @@ -319,8 +331,10 @@ for line in pluginSource.splitlines(): if line.startswith("packageName"): tokens = line.split("=") - if tokens[0].strip() == "packageName" and \ - tokens[1].strip()[1:-1] != "__core__": + if ( + tokens[0].strip() == "packageName" and + tokens[1].strip()[1:-1] != "__core__" + ): if tokens[1].strip()[0] in ['"', "'"]: packageName = tokens[1].strip()[1:-1] else: @@ -348,54 +362,69 @@ break if not packageName: - return False, \ + return ( + False, self.tr( """<p>The plugin module <b>{0}</b> does not contain """ - """a 'packageName' attribute. Aborting...</p>""")\ - .format(pluginFileName), \ + """a 'packageName' attribute. Aborting...</p>""" + ).format(pluginFileName), False + ) if pyqtApi < 2: - return False, \ + return ( + False, self.tr( """<p>The plugin module <b>{0}</b> does not conform""" - """ with the PyQt v2 API. Aborting...</p>""")\ - .format(pluginFileName), \ + """ with the PyQt v2 API. Aborting...</p>""" + ).format(pluginFileName), False + ) # check, if it is a plugin, that collides with others - if not os.path.exists(os.path.join(destination, pluginFileName)) and \ - packageName != "None" and \ - os.path.exists(os.path.join(destination, packageName)): - return False, \ + if ( + not os.path.exists(os.path.join(destination, pluginFileName)) and + packageName != "None" and + os.path.exists(os.path.join(destination, packageName)) + ): + return ( + False, self.tr("""<p>The plugin package <b>{0}</b> exists. """ - """Aborting...</p>""")\ - .format(os.path.join(destination, packageName)), \ + """Aborting...</p>""").format( + os.path.join(destination, packageName)), False + ) - if os.path.exists(os.path.join(destination, pluginFileName)) and \ - packageName != "None" and \ - not os.path.exists(os.path.join(destination, packageName)): - return False, \ + if ( + os.path.exists(os.path.join(destination, pluginFileName)) and + packageName != "None" and + not os.path.exists(os.path.join(destination, packageName)) + ): + return ( + False, self.tr("""<p>The plugin module <b>{0}</b> exists. """ - """Aborting...</p>""")\ - .format(os.path.join(destination, pluginFileName)), \ + """Aborting...</p>""").format( + os.path.join(destination, pluginFileName)), False + ) activatePlugin = False if not self.__external: - activatePlugin = \ + activatePlugin = ( not self.__pluginManager.isPluginLoaded( - installedPluginName) or \ + installedPluginName) or (self.__pluginManager.isPluginLoaded(installedPluginName) and self.__pluginManager.isPluginActive(installedPluginName)) + ) # try to unload a plugin with the same name self.__pluginManager.unloadPlugin(installedPluginName) # uninstall existing plug-in first to get clean conditions - if packageName != "None" and \ + if ( + packageName != "None" and not os.path.exists( - os.path.join(destination, packageName, "__init__.py")): + os.path.join(destination, packageName, "__init__.py")) + ): # package directory contains just data, don't delete it self.__uninstallPackage(destination, pluginFileName, "") else: @@ -419,9 +448,11 @@ self.progress.setValue(prog) QApplication.processEvents() prog += 1 - if name == pluginFileName or \ - name.startswith("{0}/".format(packageName)) or \ - name.startswith("{0}\\".format(packageName)): + if ( + name == pluginFileName or + name.startswith("{0}/".format(packageName)) or + name.startswith("{0}\\".format(packageName)) + ): outname = name.replace("/", os.sep) outname = os.path.join(destination, outname) if outname.endswith("/") or outname.endswith("\\"): @@ -449,28 +480,36 @@ self.__installedFiles.append(outname) except os.error as why: self.__rollback() - return False, \ + return ( + False, self.tr( - "Error installing plugin. Reason: {0}").format(str(why)), \ + "Error installing plugin. Reason: {0}").format(str(why)), False + ) except IOError as why: self.__rollback() - return False, \ + return ( + False, self.tr( - "Error installing plugin. Reason: {0}").format(str(why)), \ + "Error installing plugin. Reason: {0}").format(str(why)), False + ) except OSError as why: self.__rollback() - return False, \ + return ( + False, self.tr( - "Error installing plugin. Reason: {0}").format(str(why)), \ + "Error installing plugin. Reason: {0}").format(str(why)), False + ) except Exception: sys.stderr.write("Unspecific exception installing plugin.\n") self.__rollback() - return False, \ - self.tr("Unspecific exception installing plugin."), \ + return ( + False, + self.tr("Unspecific exception installing plugin."), False + ) # now compile the plugins if doCompile:
--- a/eric6/PluginManager/PluginManager.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/PluginManager/PluginManager.py Sat Sep 21 18:30:02 2019 +0200 @@ -12,11 +12,13 @@ import imp import zipfile -from PyQt5.QtCore import pyqtSignal, QObject, QDate, QFile, QFileInfo, QUrl, \ - QIODevice +from PyQt5.QtCore import ( + pyqtSignal, QObject, QDate, QFile, QFileInfo, QUrl, QIODevice +) from PyQt5.QtGui import QPixmap -from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest, \ - QNetworkReply +from PyQt5.QtNetwork import ( + QNetworkAccessManager, QNetworkRequest, QNetworkReply +) from E5Gui import E5MessageBox from E5Gui.E5Application import e5App @@ -28,9 +30,10 @@ except ImportError: SSL_AVAILABLE = False -from .PluginExceptions import PluginPathError, PluginModulesError, \ - PluginLoadError, PluginActivationError, PluginModuleFormatError, \ - PluginClassFormatError +from .PluginExceptions import ( + PluginPathError, PluginModulesError, PluginLoadError, + PluginActivationError, PluginModuleFormatError, PluginClassFormatError +) import UI.PixmapCache @@ -144,8 +147,8 @@ self.__checkPluginsDownloadDirectory() - self.pluginRepositoryFile = \ - os.path.join(Utilities.getConfigDir(), "PluginRepository") + self.pluginRepositoryFile = os.path.join(Utilities.getConfigDir(), + "PluginRepository") # attributes for the network objects self.__networkManager = QNetworkAccessManager(self) @@ -166,8 +169,10 @@ """ Public method to finalize the setup of the plugin manager. """ - for module in list(self.__onDemandInactiveModules.values()) + \ - list(self.__onDemandActiveModules.values()): + for module in ( + list(self.__onDemandInactiveModules.values()) + + list(self.__onDemandActiveModules.values()) + ): if hasattr(module, "moduleSetup"): module.moduleSetup() @@ -218,8 +223,10 @@ except IOError: del self.pluginDirs["user"] - if not os.path.exists(self.pluginDirs["global"]) and \ - os.access(Utilities.getPythonModulesDirectory(), os.W_OK): + if ( + not os.path.exists(self.pluginDirs["global"]) and + os.access(Utilities.getPythonModulesDirectory(), os.W_OK) + ): # create the global plugins directory os.mkdir(self.pluginDirs["global"], 0o755) fname = os.path.join(self.pluginDirs["global"], "__init__.py") @@ -248,19 +255,21 @@ @return flag indicating the availability of plugins (boolean) """ - if self.__develPluginFile and \ - not os.path.exists(self.__develPluginFile): + if ( + self.__develPluginFile and + not os.path.exists(self.__develPluginFile) + ): return False self.__foundCoreModules = self.getPluginModules( self.pluginDirs["eric6"]) if Preferences.getPluginManager("ActivateExternal"): if "global" in self.pluginDirs: - self.__foundGlobalModules = \ - self.getPluginModules(self.pluginDirs["global"]) + self.__foundGlobalModules = self.getPluginModules( + self.pluginDirs["global"]) if "user" in self.pluginDirs: - self.__foundUserModules = \ - self.getPluginModules(self.pluginDirs["user"]) + self.__foundUserModules = self.getPluginModules( + self.pluginDirs["user"]) return len(self.__foundCoreModules + self.__foundGlobalModules + self.__foundUserModules) > 0 @@ -309,22 +318,26 @@ """ develPluginName = "" if self.__develPluginFile: - develPluginPath, develPluginName = \ - Utilities.splitPath(self.__develPluginFile) + develPluginPath, develPluginName = Utilities.splitPath( + self.__develPluginFile) if self.isValidPluginName(develPluginName): develPluginName = develPluginName[:-3] for pluginName in self.__foundGlobalModules: # user and core plug-ins have priority - if pluginName not in self.__foundUserModules and \ - pluginName not in self.__foundCoreModules and \ - pluginName != develPluginName: + if ( + pluginName not in self.__foundUserModules and + pluginName not in self.__foundCoreModules and + pluginName != develPluginName + ): self.loadPlugin(pluginName, self.pluginDirs["global"]) for pluginName in self.__foundUserModules: # core plug-ins have priority - if pluginName not in self.__foundCoreModules and \ - pluginName != develPluginName: + if ( + pluginName not in self.__foundCoreModules and + pluginName != develPluginName + ): self.loadPlugin(pluginName, self.pluginDirs["user"]) for pluginName in self.__foundCoreModules: @@ -350,15 +363,19 @@ for pluginName in self.__foundGlobalModules: # user and core plug-ins have priority - if pluginName not in self.__foundUserModules and \ - pluginName not in self.__foundCoreModules and \ - pluginName.startswith("PluginDocumentationSets"): + if ( + pluginName not in self.__foundUserModules and + pluginName not in self.__foundCoreModules and + pluginName.startswith("PluginDocumentationSets") + ): self.loadPlugin(pluginName, self.pluginDirs["global"]) for pluginName in self.__foundUserModules: # core plug-ins have priority - if pluginName not in self.__foundCoreModules and \ - pluginName.startswith("PluginDocumentationSets"): + if ( + pluginName not in self.__foundCoreModules and + pluginName.startswith("PluginDocumentationSets") + ): self.loadPlugin(pluginName, self.pluginDirs["user"]) for pluginName in self.__foundCoreModules: @@ -392,11 +409,14 @@ if getattr(module, "autoactivate", False): self.__inactiveModules[name] = module else: - if not hasattr(module, "pluginType") or \ - not hasattr(module, "pluginTypename"): - module.error = \ - self.tr("Module is missing the 'pluginType' " - "and/or 'pluginTypename' attributes.") + if ( + not hasattr(module, "pluginType") or + not hasattr(module, "pluginTypename") + ): + module.error = self.tr( + "Module is missing the 'pluginType' " + "and/or 'pluginTypename' attributes." + ) self.__failedModules[name] = module raise PluginLoadError(name) else: @@ -482,8 +502,10 @@ if not package: package = "__None__" for moduleName in list(sys.modules.keys())[:]: - if moduleName == pluginName or \ - moduleName.split(".")[0] in packages: + if ( + moduleName == pluginName or + moduleName.split(".")[0] in packages + ): found = True del sys.modules[moduleName] return found @@ -555,8 +577,10 @@ if savedInactiveList is not None: inactiveList += [p for p in savedInactiveList if p not in self.__disabledPlugins] - if self.__develPluginName is not None and \ - self.__develPluginName in inactiveList: + if ( + self.__develPluginName is not None and + self.__develPluginName in inactiveList + ): inactiveList.remove(self.__develPluginName) names = sorted(self.__inactiveModules.keys()) for name in names: @@ -743,14 +767,18 @@ @return reference to the initialized plugin object """ for name, module in list(self.__onDemandInactiveModules.items()): - if getattr(module, "pluginType", "") == type_ and \ - getattr(module, "pluginTypename", "") == typename: + if ( + getattr(module, "pluginType", "") == type_ and + getattr(module, "pluginTypename", "") == typename + ): return self.activatePlugin(name, onDemand=True) if maybeActive: for name, module in list(self.__onDemandActiveModules.items()): - if getattr(module, "pluginType", "") == type_ and \ - getattr(module, "pluginTypename", "") == typename: + if ( + getattr(module, "pluginType", "") == type_ and + getattr(module, "pluginTypename", "") == typename + ): self.deactivatePlugin(name, onDemand=True) return self.activatePlugin(name, onDemand=True) @@ -906,10 +934,14 @@ """ pluginDict = {} - for module in list(self.__onDemandActiveModules.values()) + \ - list(self.__onDemandInactiveModules.values()): - if getattr(module, "pluginType", "") == type_ and \ - getattr(module, "error", "") == "": + for module in ( + list(self.__onDemandActiveModules.values()) + + list(self.__onDemandInactiveModules.values()) + ): + if ( + getattr(module, "pluginType", "") == type_ and + getattr(module, "error", "") == "" + ): plugin_name = getattr(module, "pluginTypename", "") if plugin_name: if hasattr(module, "displayString"): @@ -932,10 +964,14 @@ @param name name of the plugin type (string) @return preview pixmap (QPixmap) """ - for module in list(self.__onDemandActiveModules.values()) + \ - list(self.__onDemandInactiveModules.values()): - if getattr(module, "pluginType", "") == type_ and \ - getattr(module, "pluginTypename", "") == name: + for module in ( + list(self.__onDemandActiveModules.values()) + + list(self.__onDemandInactiveModules.values()) + ): + if ( + getattr(module, "pluginType", "") == type_ and + getattr(module, "pluginTypename", "") == name + ): if hasattr(module, "previewPix"): return module.previewPix() else: @@ -952,8 +988,10 @@ """ apis = [] - for module in list(self.__activeModules.values()) + \ - list(self.__onDemandActiveModules.values()): + for module in ( + list(self.__activeModules.values()) + + list(self.__onDemandActiveModules.values()) + ): if hasattr(module, "apiFiles"): apis.extend(module.apiFiles(language)) @@ -969,8 +1007,10 @@ @rtype dict (key: str, value: list of str) """ helpFiles = {} - for module in list(self.__activeModules.values()) + \ - list(self.__onDemandActiveModules.values()): + for module in ( + list(self.__activeModules.values()) + + list(self.__onDemandActiveModules.values()) + ): if hasattr(module, "helpFiles"): helpFiles.update(module.helpFiles()) @@ -1012,14 +1052,18 @@ """ infos = [] - for module in list(self.__activeModules.values()) + \ - list(self.__inactiveModules.values()): + for module in ( + list(self.__activeModules.values()) + + list(self.__inactiveModules.values()) + ): if hasattr(module, "exeDisplayDataList"): infos.extend(module.exeDisplayDataList()) elif hasattr(module, "exeDisplayData"): infos.append(module.exeDisplayData()) - for module in list(self.__onDemandActiveModules.values()) + \ - list(self.__onDemandInactiveModules.values()): + for module in ( + list(self.__onDemandActiveModules.values()) + + list(self.__onDemandInactiveModules.values()) + ): if hasattr(module, "exeDisplayDataList"): infos.extend(module.exeDisplayDataList()) elif hasattr(module, "exeDisplayData"): @@ -1060,9 +1104,11 @@ @return plug-in configuration data """ configData = {} - for module in list(self.__activeModules.values()) + \ - list(self.__onDemandActiveModules.values()) + \ - list(self.__onDemandInactiveModules.values()): + for module in ( + list(self.__activeModules.values()) + + list(self.__onDemandActiveModules.values()) + + list(self.__onDemandInactiveModules.values()) + ): if hasattr(module, 'getConfigData'): configData.update(module.getConfigData()) return configData @@ -1074,10 +1120,12 @@ @param pluginName name of the plugin to check for (string) @return flag indicating, if the plugin is loaded (boolean) """ - return pluginName in self.__activeModules or \ - pluginName in self.__inactiveModules or \ - pluginName in self.__onDemandActiveModules or \ + return ( + pluginName in self.__activeModules or + pluginName in self.__inactiveModules or + pluginName in self.__onDemandActiveModules or pluginName in self.__onDemandInactiveModules + ) def isPluginActive(self, pluginName): """ @@ -1086,8 +1134,10 @@ @param pluginName name of the plugin to check for (string) @return flag indicating, if the plugin is active (boolean) """ - return pluginName in self.__activeModules or \ + return ( + pluginName in self.__activeModules or pluginName in self.__onDemandActiveModules + ) ########################################################################### ## Specialized plug-in module handling methods below @@ -1111,8 +1161,10 @@ """ vcsDict = {} - for module in list(self.__onDemandActiveModules.values()) + \ - list(self.__onDemandInactiveModules.values()): + for module in ( + list(self.__onDemandActiveModules.values()) + + list(self.__onDemandInactiveModules.values()) + ): if getattr(module, "pluginType", "") == "version_control": if hasattr(module, "getVcsSystemIndicator"): res = module.getVcsSystemIndicator() @@ -1206,9 +1258,11 @@ elif period == 2 and lastModifiedDate.daysTo(now) < 7: # weekly return - elif period == 3 and \ + elif ( + period == 3 and (lastModifiedDate.daysTo(now) < - lastModifiedDate.daysInMonth()): + lastModifiedDate.daysInMonth()) + ): # monthly return @@ -1371,11 +1425,12 @@ @param type_ type of the plugin to clear private data for (string) """ - for module in \ - list(self.__onDemandActiveModules.values()) + \ - list(self.__onDemandInactiveModules.values()) + \ - list(self.__activeModules.values()) + \ - list(self.__inactiveModules.values()): + for module in ( + list(self.__onDemandActiveModules.values()) + + list(self.__onDemandInactiveModules.values()) + + list(self.__activeModules.values()) + + list(self.__inactiveModules.values()) + ): if getattr(module, "pluginType", "") == type_: if hasattr(module, "clearPrivateData"): module.clearPrivateData()
--- a/eric6/PluginManager/PluginRepositoryDialog.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/PluginManager/PluginRepositoryDialog.py Sat Sep 21 18:30:02 2019 +0200 @@ -15,12 +15,18 @@ import glob import re -from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QFile, QIODevice, QUrl, \ - QProcess, QPoint, QCoreApplication -from PyQt5.QtWidgets import QWidget, QDialogButtonBox, QAbstractButton, \ - QTreeWidgetItem, QDialog, QVBoxLayout, QMenu -from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest, \ - QNetworkReply, QNetworkConfigurationManager +from PyQt5.QtCore import ( + pyqtSignal, pyqtSlot, Qt, QFile, QIODevice, QUrl, QProcess, QPoint, + QCoreApplication +) +from PyQt5.QtWidgets import ( + QWidget, QDialogButtonBox, QAbstractButton, QTreeWidgetItem, QDialog, + QVBoxLayout, QMenu +) +from PyQt5.QtNetwork import ( + QNetworkAccessManager, QNetworkRequest, QNetworkReply, + QNetworkConfigurationManager +) from .Ui_PluginRepositoryDialog import Ui_PluginRepositoryDialog @@ -97,9 +103,8 @@ self.__downloadCancelButton = self.buttonBox.addButton( self.tr("Cancel"), QDialogButtonBox.ActionRole) self.__downloadCancelButton.setEnabled(False) - self.__installButton = \ - self.buttonBox.addButton(self.tr("Close && Install"), - QDialogButtonBox.ActionRole) + self.__installButton = self.buttonBox.addButton( + self.tr("Close && Install"), QDialogButtonBox.ActionRole) self.__installButton.setEnabled(False) self.__closeButton = self.buttonBox.button(QDialogButtonBox.Close) self.__closeButton.setEnabled(True) @@ -123,8 +128,8 @@ self.__pluginContextMenu.addAction( self.tr("Cleanup Downloads"), self.__cleanupDownloads) - self.pluginRepositoryFile = \ - os.path.join(Utilities.getConfigDir(), "PluginRepository") + self.pluginRepositoryFile = os.path.join(Utilities.getConfigDir(), + "PluginRepository") # attributes for the network objects self.__networkManager = QNetworkAccessManager(self) @@ -136,8 +141,9 @@ self.__replies = [] if Preferences.getUI("DynamicOnlineCheck"): - self.__networkConfigurationManager = \ + self.__networkConfigurationManager = ( QNetworkConfigurationManager(self) + ) self.__onlineStateChanged( self.__networkConfigurationManager.isOnline()) self.__networkConfigurationManager.onlineStateChanged.connect( @@ -614,30 +620,26 @@ if status == "stable": if self.__stableItem is None: - self.__stableItem = \ - QTreeWidgetItem(self.repositoryList, - [self.tr("Stable")]) + self.__stableItem = QTreeWidgetItem( + self.repositoryList, [self.tr("Stable")]) self.__stableItem.setExpanded(True) parent = self.__stableItem elif status == "unstable": if self.__unstableItem is None: - self.__unstableItem = \ - QTreeWidgetItem(self.repositoryList, - [self.tr("Unstable")]) + self.__unstableItem = QTreeWidgetItem( + self.repositoryList, [self.tr("Unstable")]) self.__unstableItem.setExpanded(True) parent = self.__unstableItem elif status == "obsolete": if self.__obsoleteItem is None: - self.__obsoleteItem = \ - QTreeWidgetItem(self.repositoryList, - [self.tr("Obsolete")]) + self.__obsoleteItem = QTreeWidgetItem( + self.repositoryList, [self.tr("Obsolete")]) self.__obsoleteItem.setExpanded(True) parent = self.__obsoleteItem else: if self.__unknownItem is None: - self.__unknownItem = \ - QTreeWidgetItem(self.repositoryList, - [self.tr("Unknown")]) + self.__unknownItem = QTreeWidgetItem( + self.repositoryList, [self.tr("Unknown")]) self.__unknownItem.setExpanded(True) parent = self.__unknownItem itm = QTreeWidgetItem(parent, [name, version, short]) @@ -687,8 +689,10 @@ # Check against installed/loaded plug-ins pluginName = filename.rsplit('-', 1)[0] pluginDetails = self.__pluginManager.getPluginDetails(pluginName) - if pluginDetails is None or \ - pluginDetails["moduleName"] != pluginName: + if ( + pluginDetails is None or + pluginDetails["moduleName"] != pluginName + ): return PluginRepositoryWidget.PluginStatusNew if pluginDetails["error"]: return PluginRepositoryWidget.PluginStatusError @@ -721,8 +725,10 @@ pluginDetails = self.__pluginManager.getPluginDetails(pluginName) if pluginDetails is None: return PluginRepositoryWidget.PluginStatusLocalUpdate - if Globals.versionToTuple(pluginDetails["version"])[:3] < \ - Globals.versionToTuple(version)[:3]: + if ( + Globals.versionToTuple(pluginDetails["version"])[:3] < + Globals.versionToTuple(version)[:3] + ): return PluginRepositoryWidget.PluginStatusLocalUpdate else: return PluginRepositoryWidget.PluginStatusUpToDate @@ -905,8 +911,10 @@ args.append(applPath) args += self.cw.getDownloadedPlugins() - if not os.path.isfile(applPath) or \ - not proc.startDetached(sys.executable, args): + if ( + not os.path.isfile(applPath) or + not proc.startDetached(sys.executable, args) + ): E5MessageBox.critical( self, self.tr('Process Generation Error'), @@ -955,8 +963,9 @@ continue try: - pluginName, pluginVersion = \ + pluginName, pluginVersion = ( pluginFile.replace(".zip", "").rsplit("-", 1) + ) pluginVersionList = re.split("[._-]", pluginVersion) for index in range(len(pluginVersionList)): try: @@ -980,8 +989,10 @@ for pluginName in downloads: downloads[pluginName].sort(key=lambda x: x[1]) - if pluginName in hiddenPlugins and \ - not Preferences.getPluginManager("KeepHidden"): + if ( + pluginName in hiddenPlugins and + not Preferences.getPluginManager("KeepHidden") + ): removeFiles = [f[0] for f in downloads[pluginName]] else: removeFiles = [f[0] for f in downloads[pluginName][
--- a/eric6/PluginManager/PluginUninstallDialog.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/PluginManager/PluginUninstallDialog.py Sat Sep 21 18:30:02 2019 +0200 @@ -82,8 +82,8 @@ for pluginName in pluginNames: fname = "{0}.py".format(os.path.join(pluginDirectory, pluginName)) self.pluginNameCombo.addItem(pluginName, fname) - self.buttonBox.button(QDialogButtonBox.Ok)\ - .setEnabled(self.pluginNameCombo.currentText() != "") + self.buttonBox.button(QDialogButtonBox.Ok).setEnabled( + self.pluginNameCombo.currentText() != "") @pyqtSlot() def on_buttonBox_accepted(self): @@ -99,11 +99,11 @@ @return flag indicating success (boolean) """ - pluginDirectory = self.pluginDirectoryCombo\ - .itemData(self.pluginDirectoryCombo.currentIndex()) + pluginDirectory = self.pluginDirectoryCombo.itemData( + self.pluginDirectoryCombo.currentIndex()) pluginName = self.pluginNameCombo.currentText() - pluginFile = self.pluginNameCombo\ - .itemData(self.pluginNameCombo.currentIndex()) + pluginFile = self.pluginNameCombo.itemData( + self.pluginNameCombo.currentIndex()) if not self.__pluginManager.unloadPlugin(pluginName): E5MessageBox.critical( @@ -132,8 +132,10 @@ packageDir = "" else: packageDir = os.path.join(pluginDirectory, package) - if hasattr(module, "prepareUninstall") and \ - not self.keepConfigurationCheckBox.isChecked(): + if ( + hasattr(module, "prepareUninstall") and + not self.keepConfigurationCheckBox.isChecked() + ): module.prepareUninstall() internalPackages = [] if hasattr(module, "internalPackages"):
--- a/eric6/Plugins/AboutPlugin/AboutDialog.py Sat Sep 21 17:41:22 2019 +0200 +++ b/eric6/Plugins/AboutPlugin/AboutDialog.py Sat Sep 21 18:30:02 2019 +0200 @@ -37,7 +37,7 @@ ).format(UI.Info.Program, UI.Info.Homepage, UI.Info.BugAddress, UI.Info.FeatureAddress) -authorsText = \ +authorsText = ( """ Detlev Offenbach Project Manager, Maintainer and German translation @@ -68,9 +68,10 @@ Gianluca Italian translations """ +) -thanksText = """\ -Phil Thompson for providing PyQt and QScintilla and pushing me into this +thanksText = ( + """Phil Thompson for providing PyQt and QScintilla and pushing me into this business. Andrew Bushnell of Fluent Inc. for contributing the multithreading debugger @@ -100,6 +101,7 @@ for providing patches to improve eric3, eric4, eric5 and eric6. And all the people who reported bugs and made suggestions.""" +) licenseText = ( """Eric is {0}