eric6/WebBrowser/SafeBrowsing/SafeBrowsingManager.py

changeset 8260
2161475d9639
parent 8220
006ee31b4835
child 8265
0090cfa83159
equal deleted inserted replaced
8259:2bbec88047dd 8260:2161475d9639
156 (0 = indefinitely) 156 (0 = indefinitely)
157 @type int 157 @type int
158 """ 158 """
159 from WebBrowser.WebBrowserWindow import WebBrowserWindow 159 from WebBrowser.WebBrowserWindow import WebBrowserWindow
160 160
161 if timeout == 0: 161 kind = (
162 kind = NotificationTypes.Critical 162 NotificationTypes.Critical
163 else: 163 if timeout == 0 else
164 kind = NotificationTypes.Information 164 NotificationTypes.Information
165 )
165 166
166 WebBrowserWindow.showNotification( 167 WebBrowserWindow.showNotification(
167 UI.PixmapCache.getPixmap("safeBrowsing48"), 168 UI.PixmapCache.getPixmap("safeBrowsing48"),
168 self.tr("Google Safe Browsing"), 169 self.tr("Google Safe Browsing"),
169 message, 170 message,
549 @param threatType threat type to get the message for 550 @param threatType threat type to get the message for
550 @type str 551 @type str
551 @return threat message 552 @return threat message
552 @rtype str 553 @rtype str
553 """ 554 """
554 if self.__apiClient: 555 msg = (
555 msg = self.__apiClient.getThreatMessage(threatType) 556 self.__apiClient.getThreatMessage(threatType)
556 else: 557 if self.__apiClient else
557 msg = "" 558 ""
559 )
558 560
559 return msg 561 return msg
560 562
561 def getThreatMessages(self, threatLists): 563 def getThreatMessages(self, threatLists):
562 """ 564 """

eric ide

mercurial