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

Unified Diff: cms/converters.py

Issue 29891645: Issue 5601 - Speed up static generation (Closed)
Patch Set: Created Sept. 25, 2018, 12:27 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cms/sources.py » ('j') | cms/sources.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cms/converters.py
===================================================================
--- a/cms/converters.py
+++ b/cms/converters.py
@@ -130,20 +130,17 @@
self._params = params
self._attribute_parser = AttributeParser(self.whitelist)
self._seen_defaults = {}
def localize_string(
self, page, name, default, comment, localedata, escapes):
def escape(s):
- return re.sub(r'.',
- lambda match: escapes.get(match.group(0),
- match.group(0)),
- s, flags=re.S)
+ return ''.join(escapes.get(c, c) for c in s)
def re_escape(s):
return re.escape(escape(s))
# Handle duplicated strings
if default:
self._seen_defaults[(page, name)] = (default, comment)
else:
« no previous file with comments | « no previous file | cms/sources.py » ('j') | cms/sources.py » ('J')

Powered by Google App Engine
This is Rietveld