fixed bug involving global variables not getting set correctly, making strings not display in html

This commit is contained in:
Micah Lee 2014-05-27 20:13:52 -04:00
parent 62a309fdb8
commit 25b55093be

View File

@ -27,7 +27,7 @@ filename = filehash = filesize = ''
@app.route("/{0}".format(slug))
def index():
global filename, filesize, filehash, slug
global filename, filesize, filehash, slug, strings
return render_template_string(open('{0}/index.html'.format(os.path.dirname(__file__))).read(),
slug=slug, filename=os.path.basename(filename), filehash=filehash, filesize=filesize, strings=strings)
@ -78,6 +78,7 @@ def load_strings(default="en"):
strings = translated[lang]
def main():
global filename, filehash, filesize
load_strings()
# validate filename
@ -140,3 +141,6 @@ def main():
# shutdown
tails_close_port(port)
if __name__ == '__main__':
main()