[tor-commits] [ooni-probe/master] Remove unneeded imports, fix call to variables out of scope.

art at torproject.org art at torproject.org
Fri Apr 29 09:42:21 UTC 2016


commit 6a1a3c1f02802db6f1c006916b0469078fa5525b
Author: Arturo Filastò <arturo at filasto.net>
Date:   Fri Feb 5 16:00:58 2016 +0100

    Remove unneeded imports, fix call to variables out of scope.
---
 ooni/oonicli.py | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/ooni/oonicli.py b/ooni/oonicli.py
index fc5eca0..b3e1013 100644
--- a/ooni/oonicli.py
+++ b/ooni/oonicli.py
@@ -8,7 +8,7 @@ import urlparse
 
 from twisted.python import usage
 from twisted.python.util import spewer
-from twisted.internet import defer, reactor, protocol, task
+from twisted.internet import defer, reactor, protocol
 
 from ooni import errors, __version__
 
@@ -123,8 +123,7 @@ def director_startup_handled_failures(failure):
 
     if isinstance(failure.value, errors.TorNotRunning):
         log.err("Tor does not appear to be running")
-        log.err("Reporting with the collector %s is not possible" %
-                global_options['collector'])
+        log.err("Reporting with a collector is not possible")
         log.msg(
             "Try with a different collector or disable collector reporting with -n")
 
@@ -226,8 +225,8 @@ def setupCollector(global_options, net_test_loader):
     return collector
 
 
-def createDeck(global_options, url=None, filename=None):
-    log.msg("Creating deck for: %s" % (url or filename,))
+def createDeck(global_options, url=None):
+    log.msg("Creating deck for: %s" % (url))
 
     deck = Deck(no_collector=global_options['no-collector'])
     deck.bouncer = global_options['bouncer']
@@ -240,8 +239,6 @@ def createDeck(global_options, url=None, filename=None):
             test_file = nettest_to_path(global_options['test_file'], True)
             if url is not None:
                 args = ('-u', url)
-            elif filename is not None:
-                args = ('-f', filename)
             else:
                 args = tuple()
             if any(global_options['subargs']):
@@ -271,9 +268,9 @@ def createDeck(global_options, url=None, filename=None):
     return deck
 
 
-def runTestWithDirector(director, global_options, url=None, filename=None,
+def runTestWithDirector(director, global_options, url=None,
                         start_tor=True, check_incoherences=True):
-    deck = createDeck(global_options, url=url, filename=filename)
+    deck = createDeck(global_options, url=url)
 
     start_tor |= deck.requiresTor
 
@@ -343,7 +340,7 @@ def runWithDirector(logging=True, start_tor=True, check_incoherences=True):
         sys.exit(0)
 
     if global_options.get('annotations') is not None:
-        annotations = setupAnnotations(global_options)
+        global_options['annotations'] = setupAnnotations(global_options)
 
     if global_options['no-collector']:
         log.msg("Not reporting using a collector")
@@ -384,7 +381,7 @@ def runWithDaemonDirector(logging=True, start_tor=True, check_incoherences=True)
     director = Director()
 
     if global_options.get('annotations') is not None:
-        annotations = setupAnnotations(global_options)
+        global_options['annotations'] = setupAnnotations(global_options)
 
     if global_options['no-collector']:
         log.msg("Not reporting using a collector")





More information about the tor-commits mailing list