From 917f929e86817f7b5c232b4a8ad192c329e0f1bb Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Wed, 14 Mar 2012 19:08:10 -0400 Subject: [PATCH] Fix template module --- library/template | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/library/template b/library/template index 3850cb152cd..110d397aa1b 100755 --- a/library/template +++ b/library/template @@ -31,8 +31,13 @@ except ImportError: # to a dictionary # FIXME: make more idiomatic -args = " ".join(sys.argv[1:]) -items = shlex.split(args) +if len(sys.argv) == 1: + sys.exit(1) +argfile = sys.argv[1] +if not os.path.exists(argfile): + sys.exit(1) +items = shlex.split(open(argfile, 'r').read()) + params = {} for x in items: (k, v) = x.split("=")