From 62a309fdb846bb86ca7032019f2ccec72a0d62ad Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Tue, 27 May 2014 19:55:24 -0400 Subject: [PATCH 1/3] removing finnish translations until I can work out utf8 bugs --- onionshare/strings.json | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/onionshare/strings.json b/onionshare/strings.json index a342ea25..99802400 100644 --- a/onionshare/strings.json +++ b/onionshare/strings.json @@ -53,15 +53,4 @@ "not_a_file": "{0} non è un file.", "filesize": "Grandezza del file", "sha1_checksum": "firma SHA1" -}, "fi": { - "punching_a_hole": "Avataan reikä palomuuriin.", - "closing_hole": "Suljetaan palomuurin reikä.", - "calculating_sha1": "Lasketaan SHA1 tarkistussumma.", - "connecting_ctrlport": "Luodaan piilopalvelu porttiin {0} Tor-hallintaportin avulla.", - "cant_connect_ctrlport": "Yhteyttä Tor-hallintaporttiin {0} ei voitu luoda. Onko Tor-ohjelma ajossa?", - "give_this_url": "Anna tämä osoite henkilölle jolle haluat lähettää tiedoston:", - "ctrlc_to_stop": "Paina Ctrl-C pysäyttääksesi palvelun", - "not_a_file": "{0} ei ole tiedosto.", - "filesize": "Tiedoston koko", - "sha1_checksum": "SHA1 tarkistussumma" }} From 25b55093be2689583fdc7741674a23d38aab6176 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Tue, 27 May 2014 20:13:52 -0400 Subject: [PATCH 2/3] fixed bug involving global variables not getting set correctly, making strings not display in html --- onionshare/onionshare.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py index 22a7b59f..324085a6 100644 --- a/onionshare/onionshare.py +++ b/onionshare/onionshare.py @@ -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() From 0cd457f47fdfb3dcf4bfdc01be0a28eb6e21a33b Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Wed, 28 May 2014 15:29:21 -0400 Subject: [PATCH 3/3] fixed bug where onionshare throws 500 on download if you don't supply absolute path --- onionshare/onionshare.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py index 324085a6..59fcfb89 100644 --- a/onionshare/onionshare.py +++ b/onionshare/onionshare.py @@ -87,6 +87,8 @@ def main(): filename = sys.argv[1] if not os.path.isfile(filename): sys.exit(strings["not_a_file"].format(filename)) + else: + filename = os.path.abspath(filename) # calculate filehash, file size print strings["calculating_sha1"]