|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.Helpviewer.CookieJar.CookieJar</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body><a NAME="top" ID="top"></a> |
|
22 <h1>eric6.Helpviewer.CookieJar.CookieJar</h1> |
|
23 <p> |
|
24 Module implementing a QNetworkCookieJar subclass with various accept policies. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#CookieJar">CookieJar</a></td> |
|
34 <td>Class implementing a QNetworkCookieJar subclass with various accept policies.</td> |
|
35 </tr> |
|
36 </table> |
|
37 <h3>Functions</h3> |
|
38 <table> |
|
39 <tr><td>None</td></tr> |
|
40 </table> |
|
41 <hr /><hr /> |
|
42 <a NAME="CookieJar" ID="CookieJar"></a> |
|
43 <h2>CookieJar</h2> |
|
44 <p> |
|
45 Class implementing a QNetworkCookieJar subclass with various accept |
|
46 policies. |
|
47 </p><h3>Signals</h3> |
|
48 <dl> |
|
49 <dt>cookiesChanged()</dt> |
|
50 <dd> |
|
51 emitted after the cookies have been changed |
|
52 </dd> |
|
53 </dl> |
|
54 <h3>Derived from</h3> |
|
55 QNetworkCookieJar |
|
56 <h3>Class Attributes</h3> |
|
57 <table> |
|
58 <tr><td>AcceptAlways</td></tr><tr><td>AcceptNever</td></tr><tr><td>AcceptOnlyFromSitesNavigatedTo</td></tr><tr><td>Allow</td></tr><tr><td>AllowForSession</td></tr><tr><td>Block</td></tr><tr><td>JAR_VERSION</td></tr><tr><td>KeepUntilExit</td></tr><tr><td>KeepUntilExpire</td></tr><tr><td>KeepUntilTimeLimit</td></tr> |
|
59 </table> |
|
60 <h3>Class Methods</h3> |
|
61 <table> |
|
62 <tr><td>None</td></tr> |
|
63 </table> |
|
64 <h3>Methods</h3> |
|
65 <table> |
|
66 <tr> |
|
67 <td><a href="#CookieJar.__init__">CookieJar</a></td> |
|
68 <td>Constructor</td> |
|
69 </tr><tr> |
|
70 <td><a href="#CookieJar.__applyRules">__applyRules</a></td> |
|
71 <td>Private method to apply the cookie rules.</td> |
|
72 </tr><tr> |
|
73 <td><a href="#CookieJar.__isOnDomainList">__isOnDomainList</a></td> |
|
74 <td>Private method to check, if either the rule matches the domain exactly or the domain ends with ".rule".</td> |
|
75 </tr><tr> |
|
76 <td><a href="#CookieJar.__purgeOldCookies">__purgeOldCookies</a></td> |
|
77 <td>Private method to purge old cookies.</td> |
|
78 </tr><tr> |
|
79 <td><a href="#CookieJar.acceptPolicy">acceptPolicy</a></td> |
|
80 <td>Public method to get the accept policy.</td> |
|
81 </tr><tr> |
|
82 <td><a href="#CookieJar.allowForSessionCookies">allowForSessionCookies</a></td> |
|
83 <td>Public method to return the allowed session cookies.</td> |
|
84 </tr><tr> |
|
85 <td><a href="#CookieJar.allowedCookies">allowedCookies</a></td> |
|
86 <td>Public method to return the allowed cookies.</td> |
|
87 </tr><tr> |
|
88 <td><a href="#CookieJar.blockedCookies">blockedCookies</a></td> |
|
89 <td>Public method to return the blocked cookies.</td> |
|
90 </tr><tr> |
|
91 <td><a href="#CookieJar.clear">clear</a></td> |
|
92 <td>Public method to clear all cookies.</td> |
|
93 </tr><tr> |
|
94 <td><a href="#CookieJar.close">close</a></td> |
|
95 <td>Public slot to close the cookie jar.</td> |
|
96 </tr><tr> |
|
97 <td><a href="#CookieJar.cookies">cookies</a></td> |
|
98 <td>Public method to get the cookies of the cookie jar.</td> |
|
99 </tr><tr> |
|
100 <td><a href="#CookieJar.cookiesForUrl">cookiesForUrl</a></td> |
|
101 <td>Public method to get the cookies for a URL.</td> |
|
102 </tr><tr> |
|
103 <td><a href="#CookieJar.filterTrackingCookies">filterTrackingCookies</a></td> |
|
104 <td>Public method to get the filter tracking cookies flag.</td> |
|
105 </tr><tr> |
|
106 <td><a href="#CookieJar.keepPolicy">keepPolicy</a></td> |
|
107 <td>Public method to get the keep policy.</td> |
|
108 </tr><tr> |
|
109 <td><a href="#CookieJar.load">load</a></td> |
|
110 <td>Public method to load the cookies.</td> |
|
111 </tr><tr> |
|
112 <td><a href="#CookieJar.loadCookies">loadCookies</a></td> |
|
113 <td>Public method to restore the saved cookies.</td> |
|
114 </tr><tr> |
|
115 <td><a href="#CookieJar.save">save</a></td> |
|
116 <td>Public method to save the cookies.</td> |
|
117 </tr><tr> |
|
118 <td><a href="#CookieJar.saveCookies">saveCookies</a></td> |
|
119 <td>Public method to save the cookies.</td> |
|
120 </tr><tr> |
|
121 <td><a href="#CookieJar.setAcceptPolicy">setAcceptPolicy</a></td> |
|
122 <td>Public method to set the accept policy.</td> |
|
123 </tr><tr> |
|
124 <td><a href="#CookieJar.setAllowForSessionCookies">setAllowForSessionCookies</a></td> |
|
125 <td>Public method to set the list of allowed session cookies.</td> |
|
126 </tr><tr> |
|
127 <td><a href="#CookieJar.setAllowedCookies">setAllowedCookies</a></td> |
|
128 <td>Public method to set the list of allowed cookies.</td> |
|
129 </tr><tr> |
|
130 <td><a href="#CookieJar.setBlockedCookies">setBlockedCookies</a></td> |
|
131 <td>Public method to set the list of blocked cookies.</td> |
|
132 </tr><tr> |
|
133 <td><a href="#CookieJar.setCookies">setCookies</a></td> |
|
134 <td>Public method to set all cookies.</td> |
|
135 </tr><tr> |
|
136 <td><a href="#CookieJar.setCookiesFromUrl">setCookiesFromUrl</a></td> |
|
137 <td>Public method to set cookies for a URL.</td> |
|
138 </tr><tr> |
|
139 <td><a href="#CookieJar.setFilterTrackingCookies">setFilterTrackingCookies</a></td> |
|
140 <td>Public method to set the filter tracking cookies flag.</td> |
|
141 </tr><tr> |
|
142 <td><a href="#CookieJar.setKeepPolicy">setKeepPolicy</a></td> |
|
143 <td>Public method to set the keep policy.</td> |
|
144 </tr> |
|
145 </table> |
|
146 <h3>Static Methods</h3> |
|
147 <table> |
|
148 <tr><td>None</td></tr> |
|
149 </table> |
|
150 <a NAME="CookieJar.__init__" ID="CookieJar.__init__"></a> |
|
151 <h4>CookieJar (Constructor)</h4> |
|
152 <b>CookieJar</b>(<i>parent=None</i>) |
|
153 <p> |
|
154 Constructor |
|
155 </p><dl> |
|
156 <dt><i>parent</i></dt> |
|
157 <dd> |
|
158 reference to the parent object (QObject) |
|
159 </dd> |
|
160 </dl><a NAME="CookieJar.__applyRules" ID="CookieJar.__applyRules"></a> |
|
161 <h4>CookieJar.__applyRules</h4> |
|
162 <b>__applyRules</b>(<i></i>) |
|
163 <p> |
|
164 Private method to apply the cookie rules. |
|
165 </p><a NAME="CookieJar.__isOnDomainList" ID="CookieJar.__isOnDomainList"></a> |
|
166 <h4>CookieJar.__isOnDomainList</h4> |
|
167 <b>__isOnDomainList</b>(<i>rules, domain</i>) |
|
168 <p> |
|
169 Private method to check, if either the rule matches the domain exactly |
|
170 or the domain ends with ".rule". |
|
171 </p><dl> |
|
172 <dt><i>rules</i></dt> |
|
173 <dd> |
|
174 list of rules (list of strings) |
|
175 </dd><dt><i>domain</i></dt> |
|
176 <dd> |
|
177 domain name to check (string) |
|
178 </dd> |
|
179 </dl><dl> |
|
180 <dt>Returns:</dt> |
|
181 <dd> |
|
182 flag indicating a match (boolean) |
|
183 </dd> |
|
184 </dl><a NAME="CookieJar.__purgeOldCookies" ID="CookieJar.__purgeOldCookies"></a> |
|
185 <h4>CookieJar.__purgeOldCookies</h4> |
|
186 <b>__purgeOldCookies</b>(<i></i>) |
|
187 <p> |
|
188 Private method to purge old cookies. |
|
189 </p><a NAME="CookieJar.acceptPolicy" ID="CookieJar.acceptPolicy"></a> |
|
190 <h4>CookieJar.acceptPolicy</h4> |
|
191 <b>acceptPolicy</b>(<i></i>) |
|
192 <p> |
|
193 Public method to get the accept policy. |
|
194 </p><dl> |
|
195 <dt>Returns:</dt> |
|
196 <dd> |
|
197 current accept policy |
|
198 </dd> |
|
199 </dl><a NAME="CookieJar.allowForSessionCookies" ID="CookieJar.allowForSessionCookies"></a> |
|
200 <h4>CookieJar.allowForSessionCookies</h4> |
|
201 <b>allowForSessionCookies</b>(<i></i>) |
|
202 <p> |
|
203 Public method to return the allowed session cookies. |
|
204 </p><dl> |
|
205 <dt>Returns:</dt> |
|
206 <dd> |
|
207 list of allowed session cookies (list of strings) |
|
208 </dd> |
|
209 </dl><a NAME="CookieJar.allowedCookies" ID="CookieJar.allowedCookies"></a> |
|
210 <h4>CookieJar.allowedCookies</h4> |
|
211 <b>allowedCookies</b>(<i></i>) |
|
212 <p> |
|
213 Public method to return the allowed cookies. |
|
214 </p><dl> |
|
215 <dt>Returns:</dt> |
|
216 <dd> |
|
217 list of allowed cookies (list of strings) |
|
218 </dd> |
|
219 </dl><a NAME="CookieJar.blockedCookies" ID="CookieJar.blockedCookies"></a> |
|
220 <h4>CookieJar.blockedCookies</h4> |
|
221 <b>blockedCookies</b>(<i></i>) |
|
222 <p> |
|
223 Public method to return the blocked cookies. |
|
224 </p><dl> |
|
225 <dt>Returns:</dt> |
|
226 <dd> |
|
227 list of blocked cookies (list of strings) |
|
228 </dd> |
|
229 </dl><a NAME="CookieJar.clear" ID="CookieJar.clear"></a> |
|
230 <h4>CookieJar.clear</h4> |
|
231 <b>clear</b>(<i></i>) |
|
232 <p> |
|
233 Public method to clear all cookies. |
|
234 </p><a NAME="CookieJar.close" ID="CookieJar.close"></a> |
|
235 <h4>CookieJar.close</h4> |
|
236 <b>close</b>(<i></i>) |
|
237 <p> |
|
238 Public slot to close the cookie jar. |
|
239 </p><a NAME="CookieJar.cookies" ID="CookieJar.cookies"></a> |
|
240 <h4>CookieJar.cookies</h4> |
|
241 <b>cookies</b>(<i></i>) |
|
242 <p> |
|
243 Public method to get the cookies of the cookie jar. |
|
244 </p><dl> |
|
245 <dt>Returns:</dt> |
|
246 <dd> |
|
247 list of all cookies (list of QNetworkCookie) |
|
248 </dd> |
|
249 </dl><a NAME="CookieJar.cookiesForUrl" ID="CookieJar.cookiesForUrl"></a> |
|
250 <h4>CookieJar.cookiesForUrl</h4> |
|
251 <b>cookiesForUrl</b>(<i>url</i>) |
|
252 <p> |
|
253 Public method to get the cookies for a URL. |
|
254 </p><dl> |
|
255 <dt><i>url</i></dt> |
|
256 <dd> |
|
257 URL to get cookies for (QUrl) |
|
258 </dd> |
|
259 </dl><dl> |
|
260 <dt>Returns:</dt> |
|
261 <dd> |
|
262 list of cookies (list of QNetworkCookie) |
|
263 </dd> |
|
264 </dl><a NAME="CookieJar.filterTrackingCookies" ID="CookieJar.filterTrackingCookies"></a> |
|
265 <h4>CookieJar.filterTrackingCookies</h4> |
|
266 <b>filterTrackingCookies</b>(<i></i>) |
|
267 <p> |
|
268 Public method to get the filter tracking cookies flag. |
|
269 </p><dl> |
|
270 <dt>Returns:</dt> |
|
271 <dd> |
|
272 filter tracking cookies flag (boolean) |
|
273 </dd> |
|
274 </dl><a NAME="CookieJar.keepPolicy" ID="CookieJar.keepPolicy"></a> |
|
275 <h4>CookieJar.keepPolicy</h4> |
|
276 <b>keepPolicy</b>(<i></i>) |
|
277 <p> |
|
278 Public method to get the keep policy. |
|
279 </p><dl> |
|
280 <dt>Returns:</dt> |
|
281 <dd> |
|
282 keep policy |
|
283 </dd> |
|
284 </dl><a NAME="CookieJar.load" ID="CookieJar.load"></a> |
|
285 <h4>CookieJar.load</h4> |
|
286 <b>load</b>(<i></i>) |
|
287 <p> |
|
288 Public method to load the cookies. |
|
289 </p><a NAME="CookieJar.loadCookies" ID="CookieJar.loadCookies"></a> |
|
290 <h4>CookieJar.loadCookies</h4> |
|
291 <b>loadCookies</b>(<i>cookies</i>) |
|
292 <p> |
|
293 Public method to restore the saved cookies. |
|
294 </p><dl> |
|
295 <dt><i>cookies</i></dt> |
|
296 <dd> |
|
297 byte array containing the saved cookies (QByteArray) |
|
298 </dd> |
|
299 </dl><dl> |
|
300 <dt>Returns:</dt> |
|
301 <dd> |
|
302 list of cookies |
|
303 </dd> |
|
304 </dl><a NAME="CookieJar.save" ID="CookieJar.save"></a> |
|
305 <h4>CookieJar.save</h4> |
|
306 <b>save</b>(<i></i>) |
|
307 <p> |
|
308 Public method to save the cookies. |
|
309 </p><a NAME="CookieJar.saveCookies" ID="CookieJar.saveCookies"></a> |
|
310 <h4>CookieJar.saveCookies</h4> |
|
311 <b>saveCookies</b>(<i>cookiesList</i>) |
|
312 <p> |
|
313 Public method to save the cookies. |
|
314 </p><dl> |
|
315 <dt><i>cookiesList</i></dt> |
|
316 <dd> |
|
317 list of cookies to be saved |
|
318 </dd> |
|
319 </dl><dl> |
|
320 <dt>Returns:</dt> |
|
321 <dd> |
|
322 saved cookies as a byte array (QByteArray) |
|
323 </dd> |
|
324 </dl><a NAME="CookieJar.setAcceptPolicy" ID="CookieJar.setAcceptPolicy"></a> |
|
325 <h4>CookieJar.setAcceptPolicy</h4> |
|
326 <b>setAcceptPolicy</b>(<i>policy</i>) |
|
327 <p> |
|
328 Public method to set the accept policy. |
|
329 </p><dl> |
|
330 <dt><i>policy</i></dt> |
|
331 <dd> |
|
332 accept policy to be set |
|
333 </dd> |
|
334 </dl><a NAME="CookieJar.setAllowForSessionCookies" ID="CookieJar.setAllowForSessionCookies"></a> |
|
335 <h4>CookieJar.setAllowForSessionCookies</h4> |
|
336 <b>setAllowForSessionCookies</b>(<i>list_</i>) |
|
337 <p> |
|
338 Public method to set the list of allowed session cookies. |
|
339 </p><dl> |
|
340 <dt><i>list_</i></dt> |
|
341 <dd> |
|
342 list of allowed session cookies (list of strings) |
|
343 </dd> |
|
344 </dl><a NAME="CookieJar.setAllowedCookies" ID="CookieJar.setAllowedCookies"></a> |
|
345 <h4>CookieJar.setAllowedCookies</h4> |
|
346 <b>setAllowedCookies</b>(<i>list_</i>) |
|
347 <p> |
|
348 Public method to set the list of allowed cookies. |
|
349 </p><dl> |
|
350 <dt><i>list_</i></dt> |
|
351 <dd> |
|
352 list of allowed cookies (list of strings) |
|
353 </dd> |
|
354 </dl><a NAME="CookieJar.setBlockedCookies" ID="CookieJar.setBlockedCookies"></a> |
|
355 <h4>CookieJar.setBlockedCookies</h4> |
|
356 <b>setBlockedCookies</b>(<i>list_</i>) |
|
357 <p> |
|
358 Public method to set the list of blocked cookies. |
|
359 </p><dl> |
|
360 <dt><i>list_</i></dt> |
|
361 <dd> |
|
362 list of blocked cookies (list of strings) |
|
363 </dd> |
|
364 </dl><a NAME="CookieJar.setCookies" ID="CookieJar.setCookies"></a> |
|
365 <h4>CookieJar.setCookies</h4> |
|
366 <b>setCookies</b>(<i>cookies</i>) |
|
367 <p> |
|
368 Public method to set all cookies. |
|
369 </p><dl> |
|
370 <dt><i>cookies</i></dt> |
|
371 <dd> |
|
372 list of cookies to be set (list of QNetworkCookie) |
|
373 </dd> |
|
374 </dl><a NAME="CookieJar.setCookiesFromUrl" ID="CookieJar.setCookiesFromUrl"></a> |
|
375 <h4>CookieJar.setCookiesFromUrl</h4> |
|
376 <b>setCookiesFromUrl</b>(<i>cookieList, url</i>) |
|
377 <p> |
|
378 Public method to set cookies for a URL. |
|
379 </p><dl> |
|
380 <dt><i>cookieList</i></dt> |
|
381 <dd> |
|
382 list of cookies to set (list of QNetworkCookie) |
|
383 </dd><dt><i>url</i></dt> |
|
384 <dd> |
|
385 url to set cookies for (QUrl) |
|
386 </dd> |
|
387 </dl><dl> |
|
388 <dt>Returns:</dt> |
|
389 <dd> |
|
390 flag indicating cookies were set (boolean) |
|
391 </dd> |
|
392 </dl><a NAME="CookieJar.setFilterTrackingCookies" ID="CookieJar.setFilterTrackingCookies"></a> |
|
393 <h4>CookieJar.setFilterTrackingCookies</h4> |
|
394 <b>setFilterTrackingCookies</b>(<i>filterTrackingCookies</i>) |
|
395 <p> |
|
396 Public method to set the filter tracking cookies flag. |
|
397 </p><dl> |
|
398 <dt><i>filterTrackingCookies</i></dt> |
|
399 <dd> |
|
400 filter tracking cookies flag (boolean) |
|
401 </dd> |
|
402 </dl><a NAME="CookieJar.setKeepPolicy" ID="CookieJar.setKeepPolicy"></a> |
|
403 <h4>CookieJar.setKeepPolicy</h4> |
|
404 <b>setKeepPolicy</b>(<i>policy</i>) |
|
405 <p> |
|
406 Public method to set the keep policy. |
|
407 </p><dl> |
|
408 <dt><i>policy</i></dt> |
|
409 <dd> |
|
410 keep policy to be set |
|
411 </dd> |
|
412 </dl> |
|
413 <div align="right"><a href="#top">Up</a></div> |
|
414 <hr /> |
|
415 </body></html> |