| LEFT | RIGHT |
| 1 # This file is part of the Adblock Plus web scripts, | 1 # This file is part of the Adblock Plus web scripts, |
| 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 'linkify': self.linkify, | 437 'linkify': self.linkify, |
| 438 'toclist': self.toclist, | 438 'toclist': self.toclist, |
| 439 } | 439 } |
| 440 | 440 |
| 441 globals = { | 441 globals = { |
| 442 'get_string': self.get_string, | 442 'get_string': self.get_string, |
| 443 'has_string': self.has_string, | 443 'has_string': self.has_string, |
| 444 'get_page_content': self.get_page_content, | 444 'get_page_content': self.get_page_content, |
| 445 'get_pages_metadata': self.get_pages_metadata, | 445 'get_pages_metadata': self.get_pages_metadata, |
| 446 'get_canonical_url': self.get_canonical_url, | 446 'get_canonical_url': self.get_canonical_url, |
| 447 'relative': self._params['relative'], | |
| 448 } | 447 } |
| 449 | 448 |
| 450 for dirname, dictionary in [('filters', filters), | 449 for dirname, dictionary in [('filters', filters), |
| 451 ('globals', globals)]: | 450 ('globals', globals)]: |
| 452 for filename in self._params['source'].list_files(dirname): | 451 for filename in self._params['source'].list_files(dirname): |
| 453 root, ext = os.path.splitext(filename) | 452 root, ext = os.path.splitext(filename) |
| 454 if ext.lower() != '.py': | 453 if ext.lower() != '.py': |
| 455 continue | 454 continue |
| 456 | 455 |
| 457 path = os.path.join(dirname, filename) | 456 path = os.path.join(dirname, filename) |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 stack[-1]['subitems'].append(item) | 589 stack[-1]['subitems'].append(item) |
| 591 stack.append(item) | 590 stack.append(item) |
| 592 return structured | 591 return structured |
| 593 | 592 |
| 594 | 593 |
| 595 converters = { | 594 converters = { |
| 596 'html': RawConverter, | 595 'html': RawConverter, |
| 597 'md': MarkdownConverter, | 596 'md': MarkdownConverter, |
| 598 'tmpl': TemplateConverter, | 597 'tmpl': TemplateConverter, |
| 599 } | 598 } |
| LEFT | RIGHT |