diff --git a/plugins/WebUi/scripts/extract_template_strings.py b/plugins/WebUi/scripts/extract_template_strings.py index b1a894b31..f9ecc3dbb 100644 --- a/plugins/WebUi/scripts/extract_template_strings.py +++ b/plugins/WebUi/scripts/extract_template_strings.py @@ -16,14 +16,14 @@ for template_dir in template_dirs: all_strings = [] for filename in files: - with open(filename,'r') as f: - content = f.read() - all_strings += re.findall("_\(\"(.*?)\"\)",content) - all_strings += re.findall("_\(\'(.*?)\'\)",content) + f = open(filename,'r') + content = f.read() + all_strings += re.findall("_\(\"(.*?)\"\)",content) + all_strings += re.findall("_\(\'(.*?)\'\)",content) all_strings = sorted(set(all_strings)) -with open ('./template_strings.py','w') as f: - for value in all_strings: - f.write("_('%s')\n" % value ) +f = open ('./template_strings.py','w') +for value in all_strings: + f.write("_('%s')\n" % value )