hgkw/keyword.py
changeset 252 001902b60bdd
parent 251 b37f2f065a9c
child 253 22e08d0f25dc
equal deleted inserted replaced
251:b37f2f065a9c 252:001902b60bdd
   171         if kwmaps:
   171         if kwmaps:
   172             self.templates = {}
   172             self.templates = {}
   173             for k, v in kwmaps:
   173             for k, v in kwmaps:
   174                 self.templates[k] = templater.parsestring(v, quoted=False)
   174                 self.templates[k] = templater.parsestring(v, quoted=False)
   175         escaped = [re.escape(k) for k in self.templates.keys()]
   175         escaped = [re.escape(k) for k in self.templates.keys()]
   176         rawkeyword = r'\$(%s)(: [^$\n\r]*? )??\$'
   176         kwpat = r'\$(%s)(: [^$\n\r]*? )??\$' % '|'.join(escaped)
   177         self.re_kw = re.compile(rawkeyword % '|'.join(escaped))
   177         self.re_kw = re.compile(kwpat)
   178         if self.t:
   178         if self.t:
   179             templater.common_filters['utcdate'] = utcdate
   179             templater.common_filters['utcdate'] = utcdate
   180             self.t = self._changeset_templater()
   180             self.t = self._changeset_templater()
   181 
   181 
   182     def _changeset_templater(self):
   182     def _changeset_templater(self):