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

Delta Between Two Patch Sets: cms/bin/generate_static_pages.py

Issue 29327966: Issue 3084 - [cms] Show full tracebacks for exceptions passing template code (Closed)
Left Patch Set: Created Sept. 15, 2015, 5:37 p.m.
Right Patch Set: Unpack converter source before calling get_html() Created Sept. 17, 2015, 10 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | cms/converters.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
(no file at all)
1 # coding: utf-8 1 # coding: utf-8
2 2
3 # This file is part of the Adblock Plus web scripts, 3 # This file is part of the Adblock Plus web scripts,
4 # Copyright (C) 2006-2015 Eyeo GmbH 4 # Copyright (C) 2006-2015 Eyeo GmbH
5 # 5 #
6 # Adblock Plus is free software: you can redistribute it and/or modify 6 # Adblock Plus is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License version 3 as 7 # it under the terms of the GNU General Public License version 3 as
8 # published by the Free Software Foundation. 8 # published by the Free Software Foundation.
9 # 9 #
10 # Adblock Plus is distributed in the hope that it will be useful, 10 # Adblock Plus is distributed in the hope that it will be useful,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 handle.write(contents) 64 handle.write(contents)
65 65
66 with MercurialSource(repo) as source: 66 with MercurialSource(repo) as source:
67 # Cache the result for some functions - we can assume here that the data 67 # Cache the result for some functions - we can assume here that the data
68 # never changes 68 # never changes
69 source.resolve_link = memoize(source.resolve_link) 69 source.resolve_link = memoize(source.resolve_link)
70 source.read_config = memoize(source.read_config) 70 source.read_config = memoize(source.read_config)
71 source.read_template = memoize(source.read_template) 71 source.read_template = memoize(source.read_template)
72 source.read_locale = memoize(source.read_locale) 72 source.read_locale = memoize(source.read_locale)
73 source.read_include = memoize(source.read_include) 73 source.read_include = memoize(source.read_include)
74 source.import_symbol = memoize(source.import_symbol) 74 source.exec_file = memoize(source.exec_file)
75 75
76 config = source.read_config() 76 config = source.read_config()
77 defaultlocale = config.get("general", "defaultlocale") 77 defaultlocale = config.get("general", "defaultlocale")
78 locales = list(source.list_locales()) 78 locales = list(source.list_locales())
79 if defaultlocale not in locales: 79 if defaultlocale not in locales:
80 locales.append(defaultlocale) 80 locales.append(defaultlocale)
81 81
82 # First pass: compile the list of pages with given translation level 82 # First pass: compile the list of pages with given translation level
83 def get_locale_file(page): 83 def get_locale_file(page):
84 try: 84 try:
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 os.rmdir(path) 141 os.rmdir(path)
142 remove_unknown(output_dir) 142 remove_unknown(output_dir)
143 143
144 if __name__ == "__main__": 144 if __name__ == "__main__":
145 if len(sys.argv) < 3: 145 if len(sys.argv) < 3:
146 print >>sys.stderr, "Usage: %s source_repository output_dir" % sys.argv[0] 146 print >>sys.stderr, "Usage: %s source_repository output_dir" % sys.argv[0]
147 sys.exit(1) 147 sys.exit(1)
148 148
149 repo, output_dir = sys.argv[1:3] 149 repo, output_dir = sys.argv[1:3]
150 generate_pages(repo, output_dir) 150 generate_pages(repo, output_dir)
LEFTRIGHT
« no previous file | cms/converters.py » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld