eric6/WebBrowser/History/HistoryMenu.py

changeset 7268
a28338eaf694
parent 7229
53054eb5b15a
child 7360
9190402e4505
--- a/eric6/WebBrowser/History/HistoryMenu.py	Wed Sep 25 18:37:35 2019 +0200
+++ b/eric6/WebBrowser/History/HistoryMenu.py	Wed Sep 25 18:48:22 2019 +0200
@@ -10,8 +10,10 @@
 
 import sys
 
-from PyQt5.QtCore import pyqtSignal, Qt, QMimeData, QUrl, QModelIndex, \
-    QSortFilterProxyModel, QAbstractProxyModel
+from PyQt5.QtCore import (
+    pyqtSignal, Qt, QMimeData, QUrl, QModelIndex, QSortFilterProxyModel,
+    QAbstractProxyModel
+)
 from PyQt5.QtWidgets import QMenu
 
 from E5Gui.E5ModelMenu import E5ModelMenu
@@ -82,9 +84,11 @@
         if not parent.isValid():
             folders = self.sourceModel().rowCount()
             bumpedItems = self.bumpedRows()
-            if bumpedItems <= self.MOVEDROWS and \
-                    bumpedItems == self.sourceModel().rowCount(
-                        self.sourceModel().index(0, 0)):
+            if (
+                bumpedItems <= self.MOVEDROWS and
+                bumpedItems == self.sourceModel().rowCount(
+                    self.sourceModel().index(0, 0))
+            ):
                 folders -= 1
             return bumpedItems + folders
         
@@ -126,15 +130,17 @@
                 return self.__treeModel.index(
                     proxyIndex.row(), proxyIndex.column(),
                     self.__treeModel.index(0, 0))
-            if bumpedItems <= self.MOVEDROWS and \
-                    bumpedItems == self.sourceModel().rowCount(
-                        self.__treeModel.index(0, 0)):
+            if (
+                bumpedItems <= self.MOVEDROWS and
+                bumpedItems == self.sourceModel().rowCount(
+                    self.__treeModel.index(0, 0))
+            ):
                 bumpedItems -= 1
             return self.__treeModel.index(proxyIndex.row() - bumpedItems,
                                           proxyIndex.column())
         
-        historyIndex = self.__treeModel.sourceModel()\
-            .index(proxyIndex.internalId(), proxyIndex.column())
+        historyIndex = self.__treeModel.sourceModel().index(
+            proxyIndex.internalId(), proxyIndex.column())
         treeIndex = self.__treeModel.mapFromSource(historyIndex)
         return treeIndex
     
@@ -150,10 +156,12 @@
         if parent is None:
             parent = QModelIndex()
         
-        if row < 0 or \
-           column < 0 or \
-           column >= self.columnCount(parent) or \
-           parent.column() > 0:
+        if (
+            row < 0 or
+            column < 0 or
+            column >= self.columnCount(parent) or
+            parent.column() > 0
+        ):
             return QModelIndex()
         
         if not parent.isValid():
@@ -190,9 +198,11 @@
         
         sourceRow = self.sourceModel().mapToSource(treeIndexParent).row()
         bumpedItems = self.bumpedRows()
-        if bumpedItems <= self.MOVEDROWS and \
-                bumpedItems == self.sourceModel().rowCount(
-                    self.sourceModel().index(0, 0)):
+        if (
+            bumpedItems <= self.MOVEDROWS and
+            bumpedItems == self.sourceModel().rowCount(
+                self.sourceModel().index(0, 0))
+        ):
             bumpedItems -= 1
         
         return self.createIndex(bumpedItems + treeIndexParent.row(),
@@ -241,14 +251,14 @@
         @return true, if left is less than right (boolean)
         """
         from .HistoryFilterModel import HistoryFilterModel
-        frequency_L = \
-            self.sourceModel().data(left, HistoryFilterModel.FrequencyRole)
-        dateTime_L = \
-            self.sourceModel().data(left, HistoryModel.DateTimeRole)
-        frequency_R = \
-            self.sourceModel().data(right, HistoryFilterModel.FrequencyRole)
-        dateTime_R = \
-            self.sourceModel().data(right, HistoryModel.DateTimeRole)
+        frequency_L = self.sourceModel().data(
+            left, HistoryFilterModel.FrequencyRole)
+        dateTime_L = self.sourceModel().data(
+            left, HistoryModel.DateTimeRole)
+        frequency_R = self.sourceModel().data(
+            right, HistoryFilterModel.FrequencyRole)
+        dateTime_R = self.sourceModel().data(
+            right, HistoryModel.DateTimeRole)
         
         # Sort results in descending frequency-derived score. If frequencies
         # are equal, sort on most recently viewed

eric ide

mercurial