[tor-commits] [ooni-probe/master] Display correct download path

art at torproject.org art at torproject.org
Sat Jan 3 15:05:12 UTC 2015


commit 9bb914c7a46b78feb2a1fb770f1f4b76a2149d05
Author: aagbsn <aagbsn at extc.org>
Date:   Sun Oct 26 13:13:26 2014 +0000

    Display correct download path
---
 ooni/resources/update.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ooni/resources/update.py b/ooni/resources/update.py
index 6479aa9..4017965 100644
--- a/ooni/resources/update.py
+++ b/ooni/resources/update.py
@@ -5,6 +5,7 @@ from twisted.web.client import downloadPage
 
 from ooni.settings import config
 from ooni.resources import inputs, geoip
+from ooni.utils import unzip, gunzip
 
 
 @defer.inlineCallbacks
@@ -12,7 +13,11 @@ def download_resource(resources):
     for filename, resource in resources.items():
         print "Downloading %s" % filename
 
-        filename = os.path.join(config.resources_directory, filename)
+        if resource["action"] in [unzip, gunzip] and resource["action_args"]:
+                    dirname = resource["action_args"][0]
+                    filename = os.path.join(dirname, filename)
+        else:
+            filename = os.path.join(config.resources_directory, filename)
         if not os.path.exists(filename):
             directory = os.path.dirname(filename)
             if not os.path.isdir(directory):





More information about the tor-commits mailing list