From e80199ffbe597021473674929e0c867b239b42a5 Mon Sep 17 00:00:00 2001 From: Pelle Nilsson Date: Sun, 16 Jun 2013 09:06:21 +0200 Subject: [PATCH] templates.py can be executed now to extract a template from command-line. --- templates.py | 6 ++++++ 1 file changed, 6 insertions(+) mode change 100644 => 100755 templates.py diff --git a/templates.py b/templates.py old mode 100644 new mode 100755 index 0ff9a09..ec7c77d --- a/templates.py +++ b/templates.py @@ -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])