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

[tor-commits] [ooni-probe/master] Add support for optFlags in nettest



commit 790d32c5d4b1c6f8ccd6bc5dbf43b6829d78af64
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Thu Nov 22 11:21:14 2012 +0100

    Add support for optFlags in nettest
---
 ooni/nettest.py |    1 +
 ooni/runner.py  |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/ooni/nettest.py b/ooni/nettest.py
index ebb58ea..c9febf4 100644
--- a/ooni/nettest.py
+++ b/ooni/nettest.py
@@ -83,6 +83,7 @@ class NetTestCase(object):
 
     optParameters = None
     baseParameters = None
+    baseFlags = None
 
     requiredOptions = []
     requiresRoot = False
diff --git a/ooni/runner.py b/ooni/runner.py
index 8edf857..158523d 100644
--- a/ooni/runner.py
+++ b/ooni/runner.py
@@ -51,9 +51,17 @@ def processTest(obj, cmd_line_options):
         obj.usageOptions.optParameters.append(obj.inputFile)
 
     if obj.usageOptions and obj.baseParameters:
+        if not hasattr(obj.usageOptions, 'optParameters'):
+            obj.usageOptions.optParameters = []
         for parameter in obj.baseParameters:
             obj.usageOptions.optParameters.append(parameter)
 
+    if obj.usageOptions and obj.baseFlags:
+        if not hasattr(obj.usageOptions, 'optFlags'):
+            obj.usageOptions.optFlags = []
+        for flag in obj.baseFlags:
+            obj.usageOptions.optFlags.append(flag)
+
     if obj.usageOptions:
         options = obj.usageOptions()
 



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