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:
parent
7a2f1d66b8
commit
e80199ffbe
6
templates.py
Normal file → Executable file
6
templates.py
Normal file → Executable 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])
|
||||
|
|
Loading…
Reference in a new issue