[tor-commits] [compass/master] Updating all paths to details.json

karsten at torproject.org karsten at torproject.org
Mon Aug 20 09:12:09 UTC 2012


commit 716f1960c39fcf080376528e30d39d91a252a64e
Author: Michael Zeltner <m at niij.org>
Date:   Fri Aug 17 22:40:42 2012 +0200

    Updating all paths to details.json
---
 compass.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compass.py b/compass.py
index 0bacc05..4d350b4 100755
--- a/compass.py
+++ b/compass.py
@@ -289,7 +289,7 @@ def create_option_parser():
 
 def download_details_file():
     url = urllib.urlopen('https://onionoo.torproject.org/details?type=relay')
-    details_file = open("details.json", 'w')
+    details_file = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'details.json'), 'w')
     details_file.write(url.read())
     url.close()
     details_file.close()
@@ -307,7 +307,7 @@ if '__main__' == __name__:
         print "Downloaded details.json.  Re-run without --download option."
         exit()
 
-    if not os.path.exists('details.json'):
+    if not os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'details.json')):
         parser.error("Did not find details.json.  Re-run with --download.")
 
     stats = RelayStats(options)





More information about the tor-commits mailing list