eric6/WebBrowser/FlashCookieManager/FlashCookieManager.py

changeset 7268
a28338eaf694
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7267:aedc309827c7 7268:a28338eaf694
109 @param cookie Flash cookie to be tested 109 @param cookie Flash cookie to be tested
110 @type FlashCookie 110 @type FlashCookie
111 @return flag indicating a blacklisted cookie 111 @return flag indicating a blacklisted cookie
112 @rtype bool 112 @rtype bool
113 """ 113 """
114 return cookie.origin in \ 114 return (
115 Preferences.getWebBrowser("FlashCookiesBlacklist") 115 cookie.origin in Preferences.getWebBrowser("FlashCookiesBlacklist")
116 )
116 117
117 def __isWhitelisted(self, cookie): 118 def __isWhitelisted(self, cookie):
118 """ 119 """
119 Private method to check for a whitelisted cookie. 120 Private method to check for a whitelisted cookie.
120 121
121 @param cookie Flash cookie to be tested 122 @param cookie Flash cookie to be tested
122 @type FlashCookie 123 @type FlashCookie
123 @return flag indicating a whitelisted cookie 124 @return flag indicating a whitelisted cookie
124 @rtype bool 125 @rtype bool
125 """ 126 """
126 return cookie.origin in \ 127 return (
127 Preferences.getWebBrowser("FlashCookiesWhitelist") 128 cookie.origin in Preferences.getWebBrowser("FlashCookiesWhitelist")
129 )
128 130
129 def __removeAllButWhitelisted(self): 131 def __removeAllButWhitelisted(self):
130 """ 132 """
131 Private method to remove all non-whitelisted cookies. 133 Private method to remove all non-whitelisted cookies.
132 """ 134 """
148 Private slot to determine the path of the shared data objects. 150 Private slot to determine the path of the shared data objects.
149 151
150 @return path of the shared data objects 152 @return path of the shared data objects
151 @rtype str 153 @rtype str
152 """ 154 """
153 if "macromedia" in self.flashPlayerDataPath().lower() or \ 155 if (
154 "/.gnash" not in self.flashPlayerDataPath().lower(): 156 "macromedia" in self.flashPlayerDataPath().lower() or
157 "/.gnash" not in self.flashPlayerDataPath().lower()
158 ):
155 return "/#SharedObjects/" 159 return "/#SharedObjects/"
156 else: 160 else:
157 return "/SharedObjects/" 161 return "/SharedObjects/"
158 162
159 def flashPlayerDataPath(self): 163 def flashPlayerDataPath(self):
184 188
185 def __autoRefresh(self): 189 def __autoRefresh(self):
186 """ 190 """
187 Private slot to refresh the list of cookies. 191 Private slot to refresh the list of cookies.
188 """ 192 """
189 if self.__flashCookieManagerDialog and \ 193 if (
190 self.__flashCookieManagerDialog.isVisible(): 194 self.__flashCookieManagerDialog and
195 self.__flashCookieManagerDialog.isVisible()
196 ):
191 return 197 return
192 198
193 oldFlashCookies = self.__flashCookies[:] 199 oldFlashCookies = self.__flashCookies[:]
194 self.__loadFlashCookies() 200 self.__loadFlashCookies()
195 newCookieList = [] 201 newCookieList = []

eric ide

mercurial