eric6/WebBrowser/WebBrowserTabWidget.py

changeset 7271
2cac5b7abcce
parent 7229
53054eb5b15a
child 7356
d975331c5daa
--- a/eric6/WebBrowser/WebBrowserTabWidget.py	Wed Sep 25 19:00:09 2019 +0200
+++ b/eric6/WebBrowser/WebBrowserTabWidget.py	Wed Sep 25 19:11:13 2019 +0200
@@ -12,8 +12,9 @@
 
 from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QUrl, QFile, QFileDevice
 from PyQt5.QtGui import QIcon, QPixmap, QPainter
-from PyQt5.QtWidgets import QWidget, QHBoxLayout, QMenu, QToolButton, \
-    QDialog, QApplication
+from PyQt5.QtWidgets import (
+    QWidget, QHBoxLayout, QMenu, QToolButton, QDialog, QApplication
+)
 from PyQt5.QtPrintSupport import QPrinter, QPrintDialog, QAbstractPrintDialog
 
 from E5Gui.E5TabWidget import E5TabWidget
@@ -244,8 +245,10 @@
             self.tabContextCloseOthersAct.setEnabled(self.count() > 1)
             
             if self.__audioAct is not None:
-                if self.widget(self.__tabContextMenuIndex).page()\
-                        .isAudioMuted():
+                if (
+                    self.widget(self.__tabContextMenuIndex).page()
+                        .isAudioMuted()
+                ):
                     self.__audioAct.setText(self.tr("Unmute Tab"))
                     self.__audioAct.setIcon(
                         UI.PixmapCache.getIcon("audioVolumeHigh.png"))
@@ -294,8 +297,10 @@
         Private slot to close all other tabs.
         """
         index = self.__tabContextMenuIndex
-        for i in list(range(self.count() - 1, index, -1)) + \
-                list(range(index - 1, -1, -1)):
+        for i in (
+            list(range(self.count() - 1, index, -1)) +
+            list(range(index - 1, -1, -1))
+        ):
             self.closeBrowserAt(i)
     
     def __tabContextMenuPrint(self):
@@ -396,8 +401,9 @@
         urlbar = UrlBar(self.__mainWindow, self)
         if self.__historyCompleter is None:
             import WebBrowser.WebBrowserWindow
-            from .History.HistoryCompleter import HistoryCompletionModel, \
-                HistoryCompleter
+            from .History.HistoryCompleter import (
+                HistoryCompletionModel, HistoryCompleter
+            )
             self.__historyCompletionModel = HistoryCompletionModel(self)
             self.__historyCompletionModel.setSourceModel(
                 WebBrowser.WebBrowserWindow.WebBrowserWindow.historyManager()
@@ -935,8 +941,10 @@
         sourceList = {}
         for i in range(self.count()):
             browser = self.widget(i)
-            if browser is not None and \
-               browser.source().isValid():
+            if (
+                browser is not None and
+                browser.source().isValid()
+            ):
                 sourceList[i] = browser.source().host()
         
         return sourceList
@@ -1046,15 +1054,19 @@
         except AttributeError:
             url = QUrl(path)
         
-        if url.scheme() == "about" and \
-           url.path() == "home":
+        if (
+            url.scheme() == "about" and
+            url.path() == "home"
+        ):
             url = QUrl("eric:home")
         
         if url.scheme() in ["s", "search"]:
             url = manager.currentEngine().searchUrl(url.path().strip())
         
-        if url.scheme() != "" and \
-           (url.host() != "" or url.path() != ""):
+        if (
+            url.scheme() != "" and
+            (url.host() != "" or url.path() != "")
+        ):
             return url
         
         urlString = Preferences.getWebBrowser("DefaultScheme") + path.strip()
@@ -1192,8 +1204,8 @@
         
         # 1. load tab data
         if "Tabs" in sessionData:
-            loadTabOnActivate = \
-                Preferences.getWebBrowser("LoadTabOnActivation")
+            loadTabOnActivate = Preferences.getWebBrowser(
+                "LoadTabOnActivation")
             for data in sessionData["Tabs"]:
                 browser = self.newBrowser(restoreSession=True)
                 if loadTabOnActivate:
@@ -1206,8 +1218,10 @@
                     browser.loadFromSessionData(data)
         
         # 2. set tab index
-        if "CurrentTabIndex" in sessionData and \
-                sessionData["CurrentTabIndex"] >= 0:
+        if (
+            "CurrentTabIndex" in sessionData and
+            sessionData["CurrentTabIndex"] >= 0
+        ):
             index = tabCount + sessionData["CurrentTabIndex"]
             self.setCurrentIndex(index)
             self.browserAt(index).activateSession()

eric ide

mercurial