| OLD | NEW |
| 1 # This file is part of Adblock Plus <https://adblockplus.org/>, | 1 # This file is part of Adblock Plus <https://adblockplus.org/>, |
| 2 # Copyright (C) 2006-present eyeo GmbH | 2 # Copyright (C) 2006-present eyeo GmbH |
| 3 # | 3 # |
| 4 # Adblock Plus is free software: you can redistribute it and/or modify | 4 # Adblock Plus is free software: you can redistribute it and/or modify |
| 5 # it under the terms of the GNU General Public License version 3 as | 5 # it under the terms of the GNU General Public License version 3 as |
| 6 # published by the Free Software Foundation. | 6 # published by the Free Software Foundation. |
| 7 # | 7 # |
| 8 # Adblock Plus is distributed in the hope that it will be useful, | 8 # Adblock Plus is distributed in the hope that it will be useful, |
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 Exceptions that thrown by the functions in this module: | 51 Exceptions that thrown by the functions in this module: |
| 52 | 52 |
| 53 - ParseError - thrown by the parser when invalid input is encountered. | 53 - ParseError - thrown by the parser when invalid input is encountered. |
| 54 - IncludeError - thrown by the renderer when an include instruction cannot | 54 - IncludeError - thrown by the renderer when an include instruction cannot |
| 55 be processed. | 55 be processed. |
| 56 - MissingHeader - thrown by the renderer when the output doesn't start with a | 56 - MissingHeader - thrown by the renderer when the output doesn't start with a |
| 57 header. | 57 header. |
| 58 | 58 |
| 59 Constants for code that works with filter lists: | 59 Constants for code that works with filter lists: |
| 60 | 60 |
| 61 - SELECTOR_TYPE - Namespace for constants that determine how the filter | 61 - SelectorType - Namespace for constants that determine how the filter |
| 62 matches content (for example: SELECTOR_TYPE.CSS): | 62 matches content (for example: SelectorType.CSS): |
| 63 | 63 |
| 64 - URL_PATTERN - Match URL against a pattern (see | 64 - URL_PATTERN - Match URL against a pattern (see |
| 65 https://adblockplus.org/filters#basic), | 65 https://adblockplus.org/filters#basic), |
| 66 - URL_REGEXP - Match URL against a regular expression, | 66 - URL_REGEXP - Match URL against a regular expression, |
| 67 - CSS - Select elements via a CSS selector, | 67 - CSS - Select elements via a CSS selector, |
| 68 - XCSS - CSS selector with extensions (to emulate CSS4), | 68 - XCSS - CSS selector with extensions (to emulate CSS4), |
| 69 - ABP_SIMPLE - Deprecated simplified element selection syntax. | 69 - ABP_SIMPLE - Deprecated simplified element selection syntax. |
| 70 | 70 |
| 71 - FILTER_ACTION - Namespace for constants that determine what the filter does | 71 - FilterAction - Namespace for constants that determine what the filter does |
| 72 with selected content (for example: FILTER_ACTION.BLOCK): | 72 with selected content (for example: FilterAction.BLOCK): |
| 73 | 73 |
| 74 - BLOCK - Block the request, | 74 - BLOCK - Block the request, |
| 75 - ALLOW - Allow the request (even if blocked by other filters), | 75 - ALLOW - Allow the request (even if blocked by other filters), |
| 76 - HIDE - Hide selected element, | 76 - HIDE - Hide selected element, |
| 77 - SHOW - Show selected element (even if hidden by other filters). | 77 - SHOW - Show selected element (even if hidden by other filters). |
| 78 | 78 |
| 79 - FILTER_OPTION - Namespace for filter option constants (for example | 79 - FilterOption - Namespace for filter option constants (for example |
| 80 FILTER_OPTION.IMAGE). See https://adblockplus.org/filters#options for the | 80 FilterOption.IMAGE). See https://adblockplus.org/filters#options for the |
| 81 full list of options. | 81 full list of options. |
| 82 | 82 |
| 83 See docstrings of module members for further information. | 83 See docstrings of module members for further information. |
| 84 | 84 |
| 85 Notes | 85 Notes |
| 86 ----- | 86 ----- |
| 87 `str` in function and method signatures always means a unicode string (Python3 | 87 `str` in function and method signatures always means a unicode string (Python3 |
| 88 meaning of `str`). | 88 meaning of `str`). |
| 89 | 89 |
| 90 """ | 90 """ |
| 91 | 91 |
| 92 from .parser import ( | 92 from .parser import ( |
| 93 FILTER_ACTION, | 93 FilterAction, |
| 94 FILTER_OPTION, | 94 FilterOption, |
| 95 SELECTOR_TYPE, | 95 SelectorType, |
| 96 ParseError, | 96 ParseError, |
| 97 parse_filterlist, | 97 parse_filterlist, |
| 98 parse_line, | 98 parse_line, |
| 99 ) | 99 ) |
| 100 from .renderer import ( | 100 from .renderer import ( |
| 101 IncludeError, | 101 IncludeError, |
| 102 MissingHeader, | 102 MissingHeader, |
| 103 render_filterlist, | 103 render_filterlist, |
| 104 ) | 104 ) |
| 105 from .sources import ( | 105 from .sources import ( |
| 106 FSSource, | 106 FSSource, |
| 107 TopSource, | 107 TopSource, |
| 108 WebSource, | 108 WebSource, |
| 109 ) | 109 ) |
| 110 | 110 |
| 111 __all__ = [ | 111 __all__ = [ |
| 112 # Constants | 112 # Constants |
| 113 'FILTER_ACTION', | 113 'FilterAction', |
| 114 'FILTER_OPTION', | 114 'FilterOption', |
| 115 'SELECTOR_TYPE', | 115 'SelectorType', |
| 116 # Exceptions | 116 # Exceptions |
| 117 'ParseError', | 117 'ParseError', |
| 118 'IncludeError', | 118 'IncludeError', |
| 119 'MissingHeader', | 119 'MissingHeader', |
| 120 # File sources | 120 # File sources |
| 121 'FSSource', | 121 'FSSource', |
| 122 'TopSource', | 122 'TopSource', |
| 123 'WebSource', | 123 'WebSource', |
| 124 # Functions | 124 # Functions |
| 125 'parse_filterlist', | 125 'parse_filterlist', |
| 126 'parse_line', | 126 'parse_line', |
| 127 'render_filterlist', | 127 'render_filterlist', |
| 128 ] | 128 ] |
| OLD | NEW |