Mercurial > hg > MakeItSo
changeset 2:825922315ce6
make shebang work
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 04 Nov 2010 18:58:11 -0700 |
parents | c2f8464e0395 |
children | 8931be6d2c8a |
files | makeitso/main.py |
diffstat | 1 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/makeitso/main.py Wed Nov 03 08:35:16 2010 -0700 +++ b/makeitso/main.py Thu Nov 04 18:58:11 2010 -0700 @@ -45,9 +45,15 @@ args = _args # get the content - content = sys.stdin.read() - template = Template(content) - print template.substitute(**variables) + if args: + for arg in args: + content = file(arg).read() + template = Template(content) + print template.substitute(**variables) + else: + content = sys.stdin.read() + template = Template(content) + print template.substitute(**variables) if __name__ == '__main__':