src/eric7/Documentation/Source/eric7.WebBrowser.AdBlock.AdBlockSubscription.html

branch
eric7
changeset 9209
b99e7fd55fd3
parent 8596
d64760b2da50
child 10436
f6881d10e995
equal deleted inserted replaced
9208:3fc8dfeb6ebe 9209:b99e7fd55fd3
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.WebBrowser.AdBlock.AdBlockSubscription</title>
4 <meta charset="UTF-8">
5 <link rel="stylesheet" href="styles.css">
6 </head>
7 <body>
8 <a NAME="top" ID="top"></a>
9 <h1>eric7.WebBrowser.AdBlock.AdBlockSubscription</h1>
10
11 <p>
12 Module implementing the AdBlock subscription class.
13 </p>
14 <h3>Global Attributes</h3>
15
16 <table>
17 <tr><td>None</td></tr>
18 </table>
19 <h3>Classes</h3>
20
21 <table>
22
23 <tr>
24 <td><a href="#AdBlockSubscription">AdBlockSubscription</a></td>
25 <td>Class implementing the AdBlock subscription.</td>
26 </tr>
27 </table>
28 <h3>Functions</h3>
29
30 <table>
31 <tr><td>None</td></tr>
32 </table>
33 <hr />
34 <hr />
35 <a NAME="AdBlockSubscription" ID="AdBlockSubscription"></a>
36 <h2>AdBlockSubscription</h2>
37
38 <p>
39 Class implementing the AdBlock subscription.
40 </p>
41 <h3>Signals</h3>
42 <dl>
43
44 <dt>changed()</dt>
45 <dd>
46 emitted after the subscription has changed
47 </dd>
48 <dt>enabledChanged(bool)</dt>
49 <dd>
50 emitted after the enabled state was changed
51 </dd>
52 <dt>rulesChanged()</dt>
53 <dd>
54 emitted after the subscription's rules have changed
55 </dd>
56 <dt>rulesEnabledChanged()</dt>
57 <dd>
58 emitted after a rule enabled state was
59 changed
60 </dd>
61 </dl>
62 <h3>Derived from</h3>
63 QObject
64 <h3>Class Attributes</h3>
65
66 <table>
67 <tr><td>None</td></tr>
68 </table>
69 <h3>Class Methods</h3>
70
71 <table>
72 <tr><td>None</td></tr>
73 </table>
74 <h3>Methods</h3>
75
76 <table>
77
78 <tr>
79 <td><a href="#AdBlockSubscription.__init__">AdBlockSubscription</a></td>
80 <td>Constructor</td>
81 </tr>
82 <tr>
83 <td><a href="#AdBlockSubscription.__loadRules">__loadRules</a></td>
84 <td>Private method to load the rules of the subscription.</td>
85 </tr>
86 <tr>
87 <td><a href="#AdBlockSubscription.__parseUrl">__parseUrl</a></td>
88 <td>Private method to parse the AdBlock URL for the subscription.</td>
89 </tr>
90 <tr>
91 <td><a href="#AdBlockSubscription.__rulesDownloaded">__rulesDownloaded</a></td>
92 <td>Private slot to deal with the downloaded rules.</td>
93 </tr>
94 <tr>
95 <td><a href="#AdBlockSubscription.__validateCheckSum">__validateCheckSum</a></td>
96 <td>Private method to check the subscription file's checksum.</td>
97 </tr>
98 <tr>
99 <td><a href="#AdBlockSubscription.addRule">addRule</a></td>
100 <td>Public method to add a rule.</td>
101 </tr>
102 <tr>
103 <td><a href="#AdBlockSubscription.allRules">allRules</a></td>
104 <td>Public method to get the list of rules.</td>
105 </tr>
106 <tr>
107 <td><a href="#AdBlockSubscription.canBeRemoved">canBeRemoved</a></td>
108 <td>Public method to check, if the subscription can be removed.</td>
109 </tr>
110 <tr>
111 <td><a href="#AdBlockSubscription.canEditRules">canEditRules</a></td>
112 <td>Public method to check, if rules can be edited.</td>
113 </tr>
114 <tr>
115 <td><a href="#AdBlockSubscription.checkForUpdate">checkForUpdate</a></td>
116 <td>Public method to check for an update.</td>
117 </tr>
118 <tr>
119 <td><a href="#AdBlockSubscription.isEnabled">isEnabled</a></td>
120 <td>Public method to check, if the subscription is enabled.</td>
121 </tr>
122 <tr>
123 <td><a href="#AdBlockSubscription.lastUpdate">lastUpdate</a></td>
124 <td>Public method to get the date and time of the last update.</td>
125 </tr>
126 <tr>
127 <td><a href="#AdBlockSubscription.location">location</a></td>
128 <td>Public method to get the subscription location.</td>
129 </tr>
130 <tr>
131 <td><a href="#AdBlockSubscription.removeRule">removeRule</a></td>
132 <td>Public method to remove a rule given the offset.</td>
133 </tr>
134 <tr>
135 <td><a href="#AdBlockSubscription.replaceRule">replaceRule</a></td>
136 <td>Public method to replace a rule given the offset.</td>
137 </tr>
138 <tr>
139 <td><a href="#AdBlockSubscription.requiresLocation">requiresLocation</a></td>
140 <td>Public method to get the location of a required subscription.</td>
141 </tr>
142 <tr>
143 <td><a href="#AdBlockSubscription.rule">rule</a></td>
144 <td>Public method to get a specific rule.</td>
145 </tr>
146 <tr>
147 <td><a href="#AdBlockSubscription.rulesFileName">rulesFileName</a></td>
148 <td>Public method to get the name of the rules file.</td>
149 </tr>
150 <tr>
151 <td><a href="#AdBlockSubscription.saveRules">saveRules</a></td>
152 <td>Public method to save the subscription rules.</td>
153 </tr>
154 <tr>
155 <td><a href="#AdBlockSubscription.setEnabled">setEnabled</a></td>
156 <td>Public method to set the enabled status.</td>
157 </tr>
158 <tr>
159 <td><a href="#AdBlockSubscription.setLocation">setLocation</a></td>
160 <td>Public method to set the subscription location.</td>
161 </tr>
162 <tr>
163 <td><a href="#AdBlockSubscription.setRuleEnabled">setRuleEnabled</a></td>
164 <td>Public method to enable a specific rule.</td>
165 </tr>
166 <tr>
167 <td><a href="#AdBlockSubscription.setTitle">setTitle</a></td>
168 <td>Public method to set the subscription title.</td>
169 </tr>
170 <tr>
171 <td><a href="#AdBlockSubscription.title">title</a></td>
172 <td>Public method to get the subscription title.</td>
173 </tr>
174 <tr>
175 <td><a href="#AdBlockSubscription.updateNow">updateNow</a></td>
176 <td>Public method to update the subscription immediately.</td>
177 </tr>
178 <tr>
179 <td><a href="#AdBlockSubscription.url">url</a></td>
180 <td>Public method to generate the URL for this subscription.</td>
181 </tr>
182 </table>
183 <h3>Static Methods</h3>
184
185 <table>
186 <tr><td>None</td></tr>
187 </table>
188
189 <a NAME="AdBlockSubscription.__init__" ID="AdBlockSubscription.__init__"></a>
190 <h4>AdBlockSubscription (Constructor)</h4>
191 <b>AdBlockSubscription</b>(<i>url, custom, parent=None, default=False</i>)
192
193 <p>
194 Constructor
195 </p>
196 <dl>
197
198 <dt><i>url</i></dt>
199 <dd>
200 AdBlock URL for the subscription (QUrl)
201 </dd>
202 <dt><i>custom</i></dt>
203 <dd>
204 flag indicating a custom subscription (boolean)
205 </dd>
206 <dt><i>parent</i></dt>
207 <dd>
208 reference to the parent object (QObject)
209 </dd>
210 <dt><i>default</i></dt>
211 <dd>
212 flag indicating a default subscription (boolean)
213 </dd>
214 </dl>
215 <a NAME="AdBlockSubscription.__loadRules" ID="AdBlockSubscription.__loadRules"></a>
216 <h4>AdBlockSubscription.__loadRules</h4>
217 <b>__loadRules</b>(<i></i>)
218
219 <p>
220 Private method to load the rules of the subscription.
221 </p>
222 <a NAME="AdBlockSubscription.__parseUrl" ID="AdBlockSubscription.__parseUrl"></a>
223 <h4>AdBlockSubscription.__parseUrl</h4>
224 <b>__parseUrl</b>(<i>url</i>)
225
226 <p>
227 Private method to parse the AdBlock URL for the subscription.
228 </p>
229 <dl>
230
231 <dt><i>url</i> (QUrl)</dt>
232 <dd>
233 AdBlock URL for the subscription
234 </dd>
235 </dl>
236 <a NAME="AdBlockSubscription.__rulesDownloaded" ID="AdBlockSubscription.__rulesDownloaded"></a>
237 <h4>AdBlockSubscription.__rulesDownloaded</h4>
238 <b>__rulesDownloaded</b>(<i>reply</i>)
239
240 <p>
241 Private slot to deal with the downloaded rules.
242 </p>
243 <dl>
244
245 <dt><i>reply</i> (QNetworkReply)</dt>
246 <dd>
247 reference to the network reply
248 </dd>
249 </dl>
250 <a NAME="AdBlockSubscription.__validateCheckSum" ID="AdBlockSubscription.__validateCheckSum"></a>
251 <h4>AdBlockSubscription.__validateCheckSum</h4>
252 <b>__validateCheckSum</b>(<i>fileName</i>)
253
254 <p>
255 Private method to check the subscription file's checksum.
256 </p>
257 <dl>
258
259 <dt><i>fileName</i> (str)</dt>
260 <dd>
261 name of the file containing the subscription
262 </dd>
263 </dl>
264 <dl>
265 <dt>Return:</dt>
266 <dd>
267 flag indicating a valid file. A file is considered
268 valid, if the checksum is OK, the file does not contain a
269 checksum (i.e. cannot be checked) or we are using the limited
270 EasyList (because we fiddled with the original).
271 </dd>
272 </dl>
273 <dl>
274 <dt>Return Type:</dt>
275 <dd>
276 bool
277 </dd>
278 </dl>
279 <a NAME="AdBlockSubscription.addRule" ID="AdBlockSubscription.addRule"></a>
280 <h4>AdBlockSubscription.addRule</h4>
281 <b>addRule</b>(<i>rule</i>)
282
283 <p>
284 Public method to add a rule.
285 </p>
286 <dl>
287
288 <dt><i>rule</i> (AdBlockRule)</dt>
289 <dd>
290 reference to the rule to add
291 </dd>
292 </dl>
293 <dl>
294 <dt>Return:</dt>
295 <dd>
296 offset of the rule
297 </dd>
298 </dl>
299 <dl>
300 <dt>Return Type:</dt>
301 <dd>
302 int
303 </dd>
304 </dl>
305 <a NAME="AdBlockSubscription.allRules" ID="AdBlockSubscription.allRules"></a>
306 <h4>AdBlockSubscription.allRules</h4>
307 <b>allRules</b>(<i></i>)
308
309 <p>
310 Public method to get the list of rules.
311 </p>
312 <dl>
313 <dt>Return:</dt>
314 <dd>
315 list of rules
316 </dd>
317 </dl>
318 <dl>
319 <dt>Return Type:</dt>
320 <dd>
321 list of AdBlockRule
322 </dd>
323 </dl>
324 <a NAME="AdBlockSubscription.canBeRemoved" ID="AdBlockSubscription.canBeRemoved"></a>
325 <h4>AdBlockSubscription.canBeRemoved</h4>
326 <b>canBeRemoved</b>(<i></i>)
327
328 <p>
329 Public method to check, if the subscription can be removed.
330 </p>
331 <dl>
332 <dt>Return:</dt>
333 <dd>
334 flag indicating removal is allowed
335 </dd>
336 </dl>
337 <dl>
338 <dt>Return Type:</dt>
339 <dd>
340 bool
341 </dd>
342 </dl>
343 <a NAME="AdBlockSubscription.canEditRules" ID="AdBlockSubscription.canEditRules"></a>
344 <h4>AdBlockSubscription.canEditRules</h4>
345 <b>canEditRules</b>(<i></i>)
346
347 <p>
348 Public method to check, if rules can be edited.
349 </p>
350 <dl>
351 <dt>Return:</dt>
352 <dd>
353 flag indicating rules may be edited
354 </dd>
355 </dl>
356 <dl>
357 <dt>Return Type:</dt>
358 <dd>
359 bool
360 </dd>
361 </dl>
362 <a NAME="AdBlockSubscription.checkForUpdate" ID="AdBlockSubscription.checkForUpdate"></a>
363 <h4>AdBlockSubscription.checkForUpdate</h4>
364 <b>checkForUpdate</b>(<i></i>)
365
366 <p>
367 Public method to check for an update.
368 </p>
369 <a NAME="AdBlockSubscription.isEnabled" ID="AdBlockSubscription.isEnabled"></a>
370 <h4>AdBlockSubscription.isEnabled</h4>
371 <b>isEnabled</b>(<i></i>)
372
373 <p>
374 Public method to check, if the subscription is enabled.
375 </p>
376 <dl>
377 <dt>Return:</dt>
378 <dd>
379 flag indicating the enabled status
380 </dd>
381 </dl>
382 <dl>
383 <dt>Return Type:</dt>
384 <dd>
385 bool
386 </dd>
387 </dl>
388 <a NAME="AdBlockSubscription.lastUpdate" ID="AdBlockSubscription.lastUpdate"></a>
389 <h4>AdBlockSubscription.lastUpdate</h4>
390 <b>lastUpdate</b>(<i></i>)
391
392 <p>
393 Public method to get the date and time of the last update.
394 </p>
395 <dl>
396 <dt>Return:</dt>
397 <dd>
398 date and time of the last update
399 </dd>
400 </dl>
401 <dl>
402 <dt>Return Type:</dt>
403 <dd>
404 QDateTime
405 </dd>
406 </dl>
407 <a NAME="AdBlockSubscription.location" ID="AdBlockSubscription.location"></a>
408 <h4>AdBlockSubscription.location</h4>
409 <b>location</b>(<i></i>)
410
411 <p>
412 Public method to get the subscription location.
413 </p>
414 <dl>
415 <dt>Return:</dt>
416 <dd>
417 URL of the subscription location
418 </dd>
419 </dl>
420 <dl>
421 <dt>Return Type:</dt>
422 <dd>
423 QUrl
424 </dd>
425 </dl>
426 <a NAME="AdBlockSubscription.removeRule" ID="AdBlockSubscription.removeRule"></a>
427 <h4>AdBlockSubscription.removeRule</h4>
428 <b>removeRule</b>(<i>offset</i>)
429
430 <p>
431 Public method to remove a rule given the offset.
432 </p>
433 <dl>
434
435 <dt><i>offset</i> (int)</dt>
436 <dd>
437 offset of the rule to remove
438 </dd>
439 </dl>
440 <a NAME="AdBlockSubscription.replaceRule" ID="AdBlockSubscription.replaceRule"></a>
441 <h4>AdBlockSubscription.replaceRule</h4>
442 <b>replaceRule</b>(<i>rule, offset</i>)
443
444 <p>
445 Public method to replace a rule given the offset.
446 </p>
447 <dl>
448
449 <dt><i>rule</i> (AdBlockRule)</dt>
450 <dd>
451 reference to the rule to set
452 </dd>
453 <dt><i>offset</i> (int)</dt>
454 <dd>
455 offset of the rule to remove
456 </dd>
457 </dl>
458 <dl>
459 <dt>Return:</dt>
460 <dd>
461 requested rule
462 </dd>
463 </dl>
464 <dl>
465 <dt>Return Type:</dt>
466 <dd>
467 AdBlockRule
468 </dd>
469 </dl>
470 <a NAME="AdBlockSubscription.requiresLocation" ID="AdBlockSubscription.requiresLocation"></a>
471 <h4>AdBlockSubscription.requiresLocation</h4>
472 <b>requiresLocation</b>(<i></i>)
473
474 <p>
475 Public method to get the location of a required subscription.
476 </p>
477 <dl>
478 <dt>Return:</dt>
479 <dd>
480 location of a required subscription
481 </dd>
482 </dl>
483 <dl>
484 <dt>Return Type:</dt>
485 <dd>
486 str
487 </dd>
488 </dl>
489 <a NAME="AdBlockSubscription.rule" ID="AdBlockSubscription.rule"></a>
490 <h4>AdBlockSubscription.rule</h4>
491 <b>rule</b>(<i>offset</i>)
492
493 <p>
494 Public method to get a specific rule.
495 </p>
496 <dl>
497
498 <dt><i>offset</i> (int)</dt>
499 <dd>
500 offset of the rule
501 </dd>
502 </dl>
503 <dl>
504 <dt>Return:</dt>
505 <dd>
506 requested rule
507 </dd>
508 </dl>
509 <dl>
510 <dt>Return Type:</dt>
511 <dd>
512 AdBlockRule
513 </dd>
514 </dl>
515 <a NAME="AdBlockSubscription.rulesFileName" ID="AdBlockSubscription.rulesFileName"></a>
516 <h4>AdBlockSubscription.rulesFileName</h4>
517 <b>rulesFileName</b>(<i></i>)
518
519 <p>
520 Public method to get the name of the rules file.
521 </p>
522 <dl>
523 <dt>Return:</dt>
524 <dd>
525 name of the rules file
526 </dd>
527 </dl>
528 <dl>
529 <dt>Return Type:</dt>
530 <dd>
531 str
532 </dd>
533 </dl>
534 <a NAME="AdBlockSubscription.saveRules" ID="AdBlockSubscription.saveRules"></a>
535 <h4>AdBlockSubscription.saveRules</h4>
536 <b>saveRules</b>(<i></i>)
537
538 <p>
539 Public method to save the subscription rules.
540 </p>
541 <a NAME="AdBlockSubscription.setEnabled" ID="AdBlockSubscription.setEnabled"></a>
542 <h4>AdBlockSubscription.setEnabled</h4>
543 <b>setEnabled</b>(<i>enabled</i>)
544
545 <p>
546 Public method to set the enabled status.
547 </p>
548 <dl>
549
550 <dt><i>enabled</i> (bool)</dt>
551 <dd>
552 flag indicating the enabled status
553 </dd>
554 </dl>
555 <a NAME="AdBlockSubscription.setLocation" ID="AdBlockSubscription.setLocation"></a>
556 <h4>AdBlockSubscription.setLocation</h4>
557 <b>setLocation</b>(<i>url</i>)
558
559 <p>
560 Public method to set the subscription location.
561 </p>
562 <dl>
563
564 <dt><i>url</i> (QUrl)</dt>
565 <dd>
566 URL of the subscription location
567 </dd>
568 </dl>
569 <a NAME="AdBlockSubscription.setRuleEnabled" ID="AdBlockSubscription.setRuleEnabled"></a>
570 <h4>AdBlockSubscription.setRuleEnabled</h4>
571 <b>setRuleEnabled</b>(<i>offset, enabled</i>)
572
573 <p>
574 Public method to enable a specific rule.
575 </p>
576 <dl>
577
578 <dt><i>offset</i> (int)</dt>
579 <dd>
580 offset of the rule
581 </dd>
582 <dt><i>enabled</i> (bool)</dt>
583 <dd>
584 new enabled state
585 </dd>
586 </dl>
587 <dl>
588 <dt>Return:</dt>
589 <dd>
590 reference to the changed rule
591 </dd>
592 </dl>
593 <dl>
594 <dt>Return Type:</dt>
595 <dd>
596 AdBlockRule
597 </dd>
598 </dl>
599 <a NAME="AdBlockSubscription.setTitle" ID="AdBlockSubscription.setTitle"></a>
600 <h4>AdBlockSubscription.setTitle</h4>
601 <b>setTitle</b>(<i>title</i>)
602
603 <p>
604 Public method to set the subscription title.
605 </p>
606 <dl>
607
608 <dt><i>title</i> (str)</dt>
609 <dd>
610 subscription title
611 </dd>
612 </dl>
613 <a NAME="AdBlockSubscription.title" ID="AdBlockSubscription.title"></a>
614 <h4>AdBlockSubscription.title</h4>
615 <b>title</b>(<i></i>)
616
617 <p>
618 Public method to get the subscription title.
619 </p>
620 <dl>
621 <dt>Return:</dt>
622 <dd>
623 subscription title
624 </dd>
625 </dl>
626 <dl>
627 <dt>Return Type:</dt>
628 <dd>
629 string
630 </dd>
631 </dl>
632 <a NAME="AdBlockSubscription.updateNow" ID="AdBlockSubscription.updateNow"></a>
633 <h4>AdBlockSubscription.updateNow</h4>
634 <b>updateNow</b>(<i></i>)
635
636 <p>
637 Public method to update the subscription immediately.
638 </p>
639 <a NAME="AdBlockSubscription.url" ID="AdBlockSubscription.url"></a>
640 <h4>AdBlockSubscription.url</h4>
641 <b>url</b>(<i></i>)
642
643 <p>
644 Public method to generate the URL for this subscription.
645 </p>
646 <dl>
647 <dt>Return:</dt>
648 <dd>
649 AdBlock URL for the subscription
650 </dd>
651 </dl>
652 <dl>
653 <dt>Return Type:</dt>
654 <dd>
655 QUrl
656 </dd>
657 </dl>
658 <div align="right"><a href="#top">Up</a></div>
659 <hr />
660 </body></html>

eric ide

mercurial