eric6/WebBrowser/WebBrowserWebSearchWidget.py

changeset 7271
2cac5b7abcce
parent 7229
53054eb5b15a
child 7360
9190402e4505
--- a/eric6/WebBrowser/WebBrowserWebSearchWidget.py	Wed Sep 25 19:00:09 2019 +0200
+++ b/eric6/WebBrowser/WebBrowserWebSearchWidget.py	Wed Sep 25 19:11:13 2019 +0200
@@ -9,8 +9,9 @@
 
 
 from PyQt5.QtCore import pyqtSignal, QUrl, QModelIndex, QTimer, Qt
-from PyQt5.QtGui import QStandardItem, QStandardItemModel, QFont, QIcon, \
-    QPixmap
+from PyQt5.QtGui import (
+    QStandardItem, QStandardItemModel, QFont, QIcon, QPixmap
+)
 from PyQt5.QtWidgets import QMenu, QCompleter
 from PyQt5.QtWebEngineWidgets import QWebEnginePage
 
@@ -112,8 +113,8 @@
             self.__recentSearches.remove(searchText)
         self.__recentSearches.insert(0, searchText)
         if len(self.__recentSearches) > self.__maxSavedSearches:
-            self.__recentSearches = \
-                self.__recentSearches[:self.__maxSavedSearches]
+            self.__recentSearches = self.__recentSearches[
+                :self.__maxSavedSearches]
         self.__setupCompleterMenu()
         
         self.__mw.currentBrowser().setFocus()
@@ -124,9 +125,11 @@
         """
         Private method to create the completer menu.
         """
-        if not self.__suggestions or \
-           (self.__model.rowCount() > 0 and
-                self.__model.item(0) != self.__suggestionsItem):
+        if (
+            not self.__suggestions or
+            (self.__model.rowCount() > 0 and
+             self.__model.item(0) != self.__suggestionsItem)
+        ):
             self.__model.clear()
             self.__suggestionsItem = None
         else:
@@ -172,12 +175,16 @@
         
         @param index index of the item (QModelIndex)
         """
-        if self.__suggestionsItem and \
-           self.__suggestionsItem.index().row() == index.row():
+        if (
+            self.__suggestionsItem and
+            self.__suggestionsItem.index().row() == index.row()
+        ):
             return
         
-        if self.__recentSearchesItem and \
-           self.__recentSearchesItem.index().row() == index.row():
+        if (
+            self.__recentSearchesItem and
+            self.__recentSearchesItem.index().row() == index.row()
+        ):
             return
         
         self.__searchNow()
@@ -189,12 +196,16 @@
         @param index index of the item (QModelIndex)
         @return flah indicating a successful highlighting (boolean)
         """
-        if self.__suggestionsItem and \
-           self.__suggestionsItem.index().row() == index.row():
+        if (
+            self.__suggestionsItem and
+            self.__suggestionsItem.index().row() == index.row()
+        ):
             return False
         
-        if self.__recentSearchesItem and \
-           self.__recentSearchesItem.index().row() == index.row():
+        if (
+            self.__recentSearchesItem and
+            self.__recentSearchesItem.index().row() == index.row()
+        ):
             return False
         
         self.setText(index.data())
@@ -224,8 +235,8 @@
         """
         searchText = self.text()
         if searchText:
-            self.__openSearchManager.currentEngine()\
-                .requestSuggestions(searchText)
+            self.__openSearchManager.currentEngine().requestSuggestions(
+                searchText)
     
     def __newSuggestions(self, suggestions):
         """

eric ide

mercurial