[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-tasks/master] task-6329: Display usage when details.json cannot be found



commit c91ad8eaf8a05f839a8270986a72599ccc2b8ca9
Author: delber <delber@xxxxxxxxxx>
Date:   Sat Jul 14 13:03:49 2012 +0000

    task-6329: Display usage when details.json cannot be found
---
 task-6329/tor-relays-stats.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/task-6329/tor-relays-stats.py b/task-6329/tor-relays-stats.py
index 5f6f633..cbb70ac 100755
--- a/task-6329/tor-relays-stats.py
+++ b/task-6329/tor-relays-stats.py
@@ -9,6 +9,7 @@
 import json
 import operator
 import sys
+import os.path
 
 class RelayStats(object):
     def __init__(self):
@@ -118,6 +119,8 @@ can issue the following command:
     sys.exit(1)
 
 if '__main__' == __name__:
+    if not os.path.exists('details.json'):
+        usage()
     if len(sys.argv) == 1:
         usage()
     func = OUTPUTS.get(sys.argv[1], None)

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits