tidy tool for Template Toolkit
Revision | 462ee6aa833ff03fa02321c549a8d65c12e69707 (tree) |
---|---|
Time | 2015-08-18 19:32:50 |
Author | hylom <hylom@user...> |
Commiter | hylom |
fix Indenter._line_scan for more precise syntax scan
@@ -29,7 +29,8 @@ class Indenter(object): | ||
29 | 29 | self.debug = debug |
30 | 30 | |
31 | 31 | def debug_print(self, s): |
32 | - sys.stderr.write(s + '\n') | |
32 | + if self.debug: | |
33 | + sys.stderr.write(s + '\n') | |
33 | 34 | |
34 | 35 | def reset(self): |
35 | 36 | self._in_template = False |
@@ -69,7 +70,7 @@ class Indenter(object): | ||
69 | 70 | else: |
70 | 71 | cursor = m.start() |
71 | 72 | offset = m.end() - m.start() |
72 | - body = line[:cursor] | |
73 | + body = line[:cursor].rstrip() + ';' | |
73 | 74 | offset = 2 |
74 | 75 | rest = line[cursor + offset:] |
75 | 76 | self._in_template = False |