1
0
Fork 0
mirror of https://github.com/Oreolek/gamebookformat.git synced 2024-04-25 21:59:21 +03:00

templates.py can be executed now to extract a template from command-line.

This commit is contained in:
Pelle Nilsson 2013-06-16 09:06:21 +02:00
parent 7a2f1d66b8
commit e80199ffbe

6
templates.py Normal file → Executable file
View file

@ -1,3 +1,5 @@
#!/usr/bin/env python2
import re
import os
import os.path
@ -58,3 +60,7 @@ class Templates (object):
if not extension:
extension = self.extension
return os.path.join(templatedir, subdir, name + "." + extension)
if __name__ == '__main__':
templates = Templates(['templates'], sys.argv[1])
print templates.get(sys.argv[2])