[tor-commits] [bridgedb/master] Pass the entire set of main options to the runner.

isis at torproject.org isis at torproject.org
Sun Jan 12 06:06:30 UTC 2014


commit e7601924c5174e900aae59ca2e9ce24ba907fa73
Author: Isis Lovecruft <isis at torproject.org>
Date:   Sat Oct 26 07:28:16 2013 +0000

    Pass the entire set of main options to the runner.
---
 lib/bridgedb/runner.py |    7 ++++---
 scripts/bridgedb       |    2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/bridgedb/runner.py b/lib/bridgedb/runner.py
index 62387c8..7f38e95 100644
--- a/lib/bridgedb/runner.py
+++ b/lib/bridgedb/runner.py
@@ -19,7 +19,7 @@ from __future__ import print_function
 import sys
 
 
-def generateDescriptors(howmany):
+def generateDescriptors(options):
     """Run a script which creates fake bridge descriptors for testing purposes.
 
     This will run scripts/gen_bridge_descriptors to create a bridge router
@@ -32,10 +32,11 @@ def generateDescriptors(howmany):
     """
     import subprocess
 
+    script = 'gen_bridge_descriptors'
+    count = options.subOptions['descriptors']
     try:
         print("Generating %s bridge descriptors..." % str(howmany))
-        proc = subprocess.Popen(['gen_bridge_descriptors', str(howmany)],
-                                stdout=sys.stdout, stderr=sys.stderr)
+        proc = subprocess.Popen([script, str(count)])
     except Exception as exc:
         print(exc)
         print("There was an error generating bridge descriptors.")
diff --git a/scripts/bridgedb b/scripts/bridgedb
index 0e20cd9..20c44b8 100644
--- a/scripts/bridgedb
+++ b/scripts/bridgedb
@@ -28,7 +28,7 @@ if options.subCommand is not None:
     sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), '../lib')))
 
     if 'descriptors' in options.subOptions:
-        runner.generateDescriptors(options.subOptions['descriptors'])
+        runner.generateDescriptors(options)
 
     if options.subCommand == 'test':
         if options.subOptions['trial']:





More information about the tor-commits mailing list