[tor-commits] [ooni-probe/master] When ooniprobe is run for the first time. Initialize it and then run the command the user wanted.

art at torproject.org art at torproject.org
Fri Jan 13 12:39:57 UTC 2017


commit 65ea56a1f7ed97466b3039197b944bd24b86fac8
Author: Arturo Filastò <arturo at filasto.net>
Date:   Thu Oct 27 22:54:23 2016 +0200

    When ooniprobe is run for the first time. Initialize it and then run the command the user wanted.
    
    This fixes: https://github.com/TheTorProject/ooni-probe/issues/650
---
 ooni/ui/cli.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/ooni/ui/cli.py b/ooni/ui/cli.py
index edb97b3..fed9606 100644
--- a/ooni/ui/cli.py
+++ b/ooni/ui/cli.py
@@ -224,18 +224,13 @@ def initializeOoniprobe(global_options):
                               should_upload=should_upload,
                               preferred_backend=preferred_backend)
     config.set_initialized()
+    print("ooniprobe is now initialized. You can begin using it!")
 
 def setupGlobalOptions(logging, start_tor, check_incoherences):
     global_options = parseOptions()
 
     config.global_options = global_options
 
-    if not config.is_initialized():
-        log.err("You first need to agree to the informed consent and setup "
-                "ooniprobe to run it.")
-        global_options['initialize'] = True
-        return global_options
-
     config.set_paths()
     config.initialize_ooni_home()
     try:
@@ -243,6 +238,9 @@ def setupGlobalOptions(logging, start_tor, check_incoherences):
     except errors.ConfigFileIncoherent:
         sys.exit(6)
 
+    if not config.is_initialized():
+        initializeOoniprobe(global_options)
+
     if global_options['verbose']:
         config.advanced.debug = True
 





More information about the tor-commits mailing list