keyword: collect kwmaps using a generator expression
Allowed for Python 2.4.
--- a/hgext/keyword.py Wed Jul 08 00:30:21 2009 +0200
+++ b/hgext/keyword.py Tue Jul 07 23:30:53 2009 +0200
@@ -124,9 +124,8 @@
kwmaps = self.ui.configitems('keywordmaps')
if kwmaps: # override default templates
- kwmaps = [(k, templater.parsestring(v, False))
- for (k, v) in kwmaps]
- self.templates = dict(kwmaps)
+ self.templates = dict((k, templater.parsestring(v, False))
+ for k, v in kwmaps)
escaped = map(re.escape, self.templates.keys())
kwpat = r'\$(%s)(: [^$\n\r]*? )??\$' % '|'.join(escaped)
self.re_kw = re.compile(kwpat)