src/eric7/WebBrowser/ImageSearch/ImageSearchEngine.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9413
80c06d472826
--- a/src/eric7/WebBrowser/ImageSearch/ImageSearchEngine.py	Wed Jul 13 11:16:20 2022 +0200
+++ b/src/eric7/WebBrowser/ImageSearch/ImageSearchEngine.py	Wed Jul 13 14:55:47 2022 +0200
@@ -16,48 +16,49 @@
     """
     Class implementing the image search engine.
     """
+
     def __init__(self, parent=None):
         """
         Constructor
-        
+
         @param parent reference to the parent object
         @type QObject
         """
         super().__init__(parent)
-        
+
         self.__searchEngineNames = ["Google", "TinEye", "Yandex"]
-    
+
     def searchEngine(self):
         """
         Public method to get the name of the current search engine.
-        
+
         @return name of the current search engine
         @rtype str
         """
         return Preferences.getWebBrowser("ImageSearchEngine")
-    
+
     def setSearchEngine(self, searchEngine):
         """
         Public method to set the current search engine.
-        
+
         @param searchEngine name of the search engine
         @type str
         """
         Preferences.setWebBrowser("ImageSearchEngine", searchEngine)
-    
+
     def searchEngineNames(self):
         """
         Public method to get the list of supported search engines.
-        
+
         @return list of supported search engines
         @rtype list of str
         """
         return self.__searchEngineNames[:]
-    
+
     def getSearchQuery(self, imageUrl, searchEngine=None):
         """
         Public method to get the image search query URL.
-        
+
         @param imageUrl URL of the image to search for
         @type QUrl
         @param searchEngine name of the image search engine to be used
@@ -67,18 +68,21 @@
         """
         if not searchEngine:
             searchEngine = self.searchEngine()
-        
+
         searchEngine_l = searchEngine.lower()
-        if searchEngine_l == "google":              # __IGNORE_WARNING_Y116__
-            return QUrl("https://www.google.com/searchbyimage?"
-                        "site=search&image_url={0}".format(
-                            imageUrl.toString()))
+        if searchEngine_l == "google":  # __IGNORE_WARNING_Y116__
+            return QUrl(
+                "https://www.google.com/searchbyimage?"
+                "site=search&image_url={0}".format(imageUrl.toString())
+            )
         elif searchEngine_l == "yandex":
-            return QUrl("https://yandex.com/images/search?"
-                        "&img_url={0}&rpt=imageview".format(
-                            imageUrl.toString()))
+            return QUrl(
+                "https://yandex.com/images/search?"
+                "&img_url={0}&rpt=imageview".format(imageUrl.toString())
+            )
         elif searchEngine_l == "tineye":
-            return QUrl("http://www.tineye.com/search?url={0}".format(
-                imageUrl.toString()))
+            return QUrl(
+                "http://www.tineye.com/search?url={0}".format(imageUrl.toString())
+            )
         else:
             return QUrl()

eric ide

mercurial