eric6/WebBrowser/WebBrowserPage.py

changeset 8221
0572a215bd2f
parent 8218
7c09585bd960
child 8243
cc717c2ae956
diff -r 006ee31b4835 -r 0572a215bd2f eric6/WebBrowser/WebBrowserPage.py
--- a/eric6/WebBrowser/WebBrowserPage.py	Sun Apr 11 12:38:16 2021 +0200
+++ b/eric6/WebBrowser/WebBrowserPage.py	Sun Apr 11 16:53:48 2021 +0200
@@ -138,9 +138,11 @@
             return False
         
         # AdBlock
-        if url.scheme() == "abp":
-            if WebBrowserWindow.adBlockManager().addSubscriptionFromUrl(url):
-                return False
+        if (
+            url.scheme() == "abp" and
+            WebBrowserWindow.adBlockManager().addSubscriptionFromUrl(url)
+        ):
+            return False
         
         # GreaseMonkey
         try:
@@ -565,10 +567,10 @@
                 "})()",
                 WebBrowserPage.SafeJsWorld
             )
-            if pos is not None:
-                pos = QPointF(pos["x"], pos["y"])
-            else:
-                pos = QPointF(0.0, 0.0)
+            pos = (
+                QPointF(0.0, 0.0) if pos is None
+                else QPointF(pos["x"], pos["y"])
+            )
             
             return pos
     
@@ -726,12 +728,7 @@
             Preferences.Prefs.settings.value("Ssl/CaCertificatesDict"))
         for server in certificateDict:
             localCAList = QSslCertificate.fromData(certificateDict[server])
-            for cert in certList:
-                if cert in localCAList:
-                    return True
+            if any(cert in localCAList for cert in certList):
+                return True
         
-        for cert in certList:
-            if cert.isBlacklisted():
-                return False
-        
-        return True
+        return all(not cert.isBlacklisted() for cert in certList)

eric ide

mercurial