Rename kwtemplater.t to kwtemplater.ct
authorChristian Ebert <blacktrash@gmx.net>
Sat, 01 Dec 2007 13:15:13 +0100
changeset 306 78b80b2511de
parent 305 d3cdaa49a644
child 307 32061d23db14
Rename kwtemplater.t to kwtemplater.ct
hgkw/keyword.py
--- a/hgkw/keyword.py	Sat Dec 01 10:32:40 2007 +0100
+++ b/hgkw/keyword.py	Sat Dec 01 13:15:13 2007 +0100
@@ -110,7 +110,7 @@
     def __init__(self, ui, repo, expand, path='', node=None):
         self.ui = ui
         self.repo = repo
-        self.t = expand or None
+        self.ct = expand or None
         self.path = path
         self.node = node
 
@@ -122,10 +122,10 @@
         escaped = map(re.escape, self.templates.keys())
         kwpat = r'\$(%s)(: [^$\n\r]*? )??\$' % '|'.join(escaped)
         self.re_kw = re.compile(kwpat)
-        if self.t:
+        if self.ct:
             templater.common_filters['utcdate'] = utcdate
-            self.t = cmdutil.changeset_templater(self.ui, self.repo,
-                                                 False, '', False)
+            self.ct = cmdutil.changeset_templater(self.ui, self.repo,
+                                                  False, '', False)
 
     def substitute(self, node, data, subfunc):
         '''Obtains node if missing, and calls given substitution function.'''
@@ -136,10 +136,10 @@
         def kwsub(mobj):
             '''Substitutes keyword using corresponding template.'''
             kw = mobj.group(1)
-            self.t.use_template(self.templates[kw])
+            self.ct.use_template(self.templates[kw])
             self.ui.pushbuffer()
-            self.t.show(changenode=self.node,
-                        root=self.repo.root, file=self.path)
+            self.ct.show(changenode=self.node,
+                         root=self.repo.root, file=self.path)
             return '$%s: %s $' % (kw, templater.firstline(self.ui.popbuffer()))
 
         return subfunc(kwsub, data)
@@ -157,7 +157,7 @@
         Keywords in data are expanded, if templater was initialized.'''
         if util.binary(data):
             return data, None
-        if self.t:
+        if self.ct:
             return self.substitute(node, data, self.re_kw.subn)
         return data, self.re_kw.search(data)
 
@@ -171,7 +171,7 @@
         '''Overwrites files in working directory if keywords are detected.
         Keywords are expanded if keyword templater is initialized,
         otherwise their substitution is removed.'''
-        expand = self.t is not None
+        expand = self.ct is not None
         action = ('shrinking', 'expanding')[expand]
         notify = (self.ui.note, self.ui.debug)[commit]
         for f in candidates: