eric6/WebBrowser/SafeBrowsing/SafeBrowsingManager.py

changeset 8260
2161475d9639
parent 8220
006ee31b4835
child 8265
0090cfa83159
--- a/eric6/WebBrowser/SafeBrowsing/SafeBrowsingManager.py	Wed Apr 21 19:40:50 2021 +0200
+++ b/eric6/WebBrowser/SafeBrowsing/SafeBrowsingManager.py	Thu Apr 22 18:02:47 2021 +0200
@@ -158,10 +158,11 @@
         """
         from WebBrowser.WebBrowserWindow import WebBrowserWindow
         
-        if timeout == 0:
-            kind = NotificationTypes.Critical
-        else:
-            kind = NotificationTypes.Information
+        kind = (
+            NotificationTypes.Critical
+            if timeout == 0 else
+            NotificationTypes.Information
+        )
         
         WebBrowserWindow.showNotification(
             UI.PixmapCache.getPixmap("safeBrowsing48"),
@@ -551,10 +552,11 @@
         @return threat message
         @rtype str
         """
-        if self.__apiClient:
-            msg = self.__apiClient.getThreatMessage(threatType)
-        else:
-            msg = ""
+        msg = (
+            self.__apiClient.getThreatMessage(threatType)
+            if self.__apiClient else
+            ""
+        )
         
         return msg
     

eric ide

mercurial