Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: cms/converters.py

Issue 29933596: Issue 5333 - Allow cms to generate relative pages (Closed) Base URL: https://hg.adblockplus.org/cms/
Left Patch Set: Remove last ipdb comment Created Nov. 9, 2018, 5:17 p.m.
Right Patch Set: Add documentation, remove extraneous global Created Nov. 9, 2018, 8:16 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « cms/bin/generate_static_pages.py ('k') | cms/utils.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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
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 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld