Collect kwmaps using a generator expression
authorChristian Ebert <blacktrash@gmx.net>
Tue, 07 Jul 2009 23:30:53 +0200
changeset 609 fefdf82b2320
parent 608 6bad7f6bb4a5
child 611 c50f56b5f4b8
Collect kwmaps using a generator expression Allowed for Python 2.4.
hgkw/keyword.py
--- a/hgkw/keyword.py	Wed Jul 08 03:09:07 2009 +0200
+++ b/hgkw/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)