From dd445c9b6fbe180fb7bef5df89abb7fb6e2ef6e8 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sun, 6 Jan 2013 22:40:32 -0700 Subject: change tpl conversion script to support Python 2.4 --- mods/friendica-to-smarty-tpl.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'mods/friendica-to-smarty-tpl.py') diff --git a/mods/friendica-to-smarty-tpl.py b/mods/friendica-to-smarty-tpl.py index b82aa912a..ff1a102a4 100755 --- a/mods/friendica-to-smarty-tpl.py +++ b/mods/friendica-to-smarty-tpl.py @@ -189,10 +189,14 @@ for a_file in files: filename = os.path.join(path,a_file) ext = a_file.split('.')[-1] if os.path.isfile(filename) and ext == 'tpl': - with open(filename, 'r') as f: - newfilename = os.path.join(outpath,a_file) - with open(newfilename, 'w') as outf: - print "Converting " + filename + " to " + newfilename - convert(f, outf, php_tpl) + f = open(filename, 'r') + newfilename = os.path.join(outpath,a_file) + outf = open(newfilename, 'w') + + print "Converting " + filename + " to " + newfilename + convert(f, outf, php_tpl) + + outf.close() + f.close() -- cgit v1.2.3