eric6/WebBrowser/Session/SessionManager.py

changeset 7269
0c63ea7f94bd
parent 7229
53054eb5b15a
child 7360
9190402e4505
diff -r a28338eaf694 -r 0c63ea7f94bd eric6/WebBrowser/Session/SessionManager.py
--- a/eric6/WebBrowser/Session/SessionManager.py	Wed Sep 25 18:48:22 2019 +0200
+++ b/eric6/WebBrowser/Session/SessionManager.py	Wed Sep 25 18:52:40 2019 +0200
@@ -11,11 +11,14 @@
 import os
 import json
 
-from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QObject, QTimer, QDir, \
-    QFile, QFileInfo, QFileSystemWatcher, QByteArray, QDateTime
-from PyQt5.QtWidgets import QActionGroup, QApplication, \
-    QInputDialog, QLineEdit, QDialog, QDialogButtonBox, QLabel, QComboBox, \
-    QVBoxLayout
+from PyQt5.QtCore import (
+    pyqtSlot, pyqtSignal, Qt, QObject, QTimer, QDir, QFile, QFileInfo,
+    QFileSystemWatcher, QByteArray, QDateTime
+)
+from PyQt5.QtWidgets import (
+    QActionGroup, QApplication, QInputDialog, QLineEdit, QDialog,
+    QDialogButtonBox, QLabel, QComboBox, QVBoxLayout
+)
 
 from E5Gui import E5MessageBox
 
@@ -80,8 +83,8 @@
         if not QFile.exists(self.__lastActiveSession):
             self.__lastActiveSession = self.__sessionDefault
         
-        self.__sessionsDirectoryWatcher = \
-            QFileSystemWatcher([self.getSessionsDirectory()], self)
+        self.__sessionsDirectoryWatcher = QFileSystemWatcher(
+            [self.getSessionsDirectory()], self)
         self.__sessionsDirectoryWatcher.directoryChanged.connect(
             self.__sessionDirectoryChanged)
         
@@ -202,8 +205,9 @@
             sessionData["Windows"].append(data)
             
             if window is activeWindow:
-                sessionData["CurrentWindowIndex"] = \
+                sessionData["CurrentWindowIndex"] = (
                     len(sessionData["Windows"]) - 1
+                )
         
         if sessionData["Windows"]:
             sessionFile = open(sessionFileName, "w")
@@ -415,8 +419,9 @@
             
             if not ((flags & SessionManager.ReplaceSession) ==
                     SessionManager.ReplaceSession):
-                self.__lastActiveSession = \
+                self.__lastActiveSession = (
                     QFileInfo(sessionFilePath).canonicalFilePath()
+                )
                 self.__sessionMetaData = []
         
         self.restoreSessionFromData(window, sessionData)
@@ -446,8 +451,9 @@
         
         # restore additional windows
         for data in sessionData["Windows"]:
-            window = WebBrowserWindow.mainWindow()\
-                .newWindow(restoreSession=True)
+            window = (
+                WebBrowserWindow.mainWindow().newWindow(restoreSession=True)
+            )
             window.tabWidget().loadFromSessionData(data)
             if "WindowGeometry" in data:
                 geometry = QByteArray.fromBase64(
@@ -459,8 +465,9 @@
         if "CurrentWindowIndex" in sessionData:
             currentWindowIndex = sessionData["CurrentWindowIndex"]
             try:
-                currentWindow = \
+                currentWindow = (
                     WebBrowserWindow.mainWindows()[currentWindowIndex]
+                )
                 QTimer.singleShot(0, lambda: currentWindow.raise_())
             except IndexError:
                 # ignore it

eric ide

mercurial