• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

tidy tool for Template Toolkit


Commit MetaInfo

修訂9d00c1bfa7eb43f97f69bc8c12e49b55f1627ae0 (tree)
時間2015-07-08 20:27:47
作者hylom <hylom@user...>
Commiterhylom

Log Message

add '--directives' option for debug

Change Summary

差異

--- a/tttidy.py
+++ b/tttidy.py
@@ -150,9 +150,18 @@ def main():
150150 parser = argparse.ArgumentParser('tidy tool for template toolkit')
151151 parser.add_argument('file', type=file)
152152 parser.add_argument('--unindent', '-u', action='store_true')
153+ parser.add_argument('--directives', action='store_true')
153154
154155 args = parser.parse_args()
155156
157+ # when '--directives' is given, extract directives
158+ # this is for debug
159+ if args.directives:
160+ indenter = Indenter()
161+ r = indenter.extract_directives(args.file)
162+ print "\n".join(r)
163+ return
164+
156165 # when '--unindent' is given, do unindent
157166 if args.unindent:
158167 ret = unindent(args.file)