[tor-commits] [ooni-probe/master] Refactor the condition checking to not use an array

art at torproject.org art at torproject.org
Thu Aug 7 15:15:26 UTC 2014


commit 3f98daed0f65d745f09970c28e53f168bcb6aecd
Author: Arturo Filastò <art at fuffa.org>
Date:   Thu Aug 7 17:06:45 2014 +0200

    Refactor the condition checking to not use an array
---
 ooni/oonicli.py |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/ooni/oonicli.py b/ooni/oonicli.py
index cfc7ddc..77e0a78 100644
--- a/ooni/oonicli.py
+++ b/ooni/oonicli.py
@@ -173,11 +173,11 @@ def runWithDirector(logging=True, start_tor=True):
 
     deck = Deck()
     deck.bouncer = global_options['bouncer']
-    conditions_to_start_tor = [False]
+    start_tor = False
     if global_options['bouncer']:
-        conditions_to_start_tor.append(True)
+        start_tor |= True
     if global_options['collector']:
-        conditions_to_start_tor.append(True)
+        start_tor |= True
 
     try:
         if global_options['testdeck']:
@@ -204,8 +204,7 @@ def runWithDirector(logging=True, start_tor=True):
         log.err(e)
         sys.exit(5)
 
-    conditions_to_start_tor.append(deck.requiresTor)
-    start_tor = any(conditions_to_start_tor)
+    start_tor |= deck.requiresTor
     d = director.start(start_tor=start_tor)
 
     def setup_nettest(_):





More information about the tor-commits mailing list