commit 9d67a329fda4b81a4a0f0ad9f25f349f86ba4ea5 Author: Arturo Filastò arturo@filasto.net Date: Wed Nov 7 20:09:00 2012 +0100
Rename advancedOptParameters to usageOptions * Change all references to the new name --- nettests/bridge_reachability/bridget.py | 2 +- nettests/core/http_host.py | 11 +++++++---- ooni/nettest.py | 4 ++-- ooni/runner.py | 6 +++--- 4 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/nettests/bridge_reachability/bridget.py b/nettests/bridge_reachability/bridget.py index 6bad316..acf3dff 100644 --- a/nettests/bridge_reachability/bridget.py +++ b/nettests/bridge_reachability/bridget.py @@ -109,7 +109,7 @@ class BridgetTest(nettest.NetTestCase): author = "Isis Lovecruft isis@torproject.org" version = "0.1" description = "Use a Tor process to test connecting to bridges or relays" - advancedOptParameters = BridgetArgs + usageOptions = BridgetArgs
def setUp(self): """ diff --git a/nettests/core/http_host.py b/nettests/core/http_host.py index 62b50ca..07c7019 100644 --- a/nettests/core/http_host.py +++ b/nettests/core/http_host.py @@ -11,6 +11,13 @@
from ooni.templates import httpt
+class UsageOptions(usage.Options): + optParameters = [ + ['url', 'u', 'http://torproject.org/', 'Test single site'], + ['backend', 'b', 'http://ooni.nu/test/', 'Test backend to use'], + ] + + class HTTPHost(httpt.HTTPTest): """ This test is aimed at detecting the presence of a transparent HTTP proxy @@ -20,10 +27,6 @@ class HTTPHost(httpt.HTTPTest): author = "Arturo Filastò" version = 0.1
- optParameters = [['url', 'u', 'http://torproject.org/', 'Test single site'], - ['backend', 'b', 'http://ooni.nu/test/', 'Test backend to use'], - ] - inputFile = ['urls', 'f', None, 'Urls file']
def test_send_host_header(self): diff --git a/ooni/nettest.py b/ooni/nettest.py index 3534a32..dc7188d 100644 --- a/ooni/nettest.py +++ b/ooni/nettest.py @@ -113,7 +113,7 @@ class NetTestCase(unittest.TestCase):
| optParameters = [['outfile', 'O', 'outfile.log', 'Description...']]
- * advancedOptParameters: a subclass of twisted.python.usage.Options for more advanced command line arguments fun. + * usageOptions: a subclass of twisted.python.usage.Options for more advanced command line arguments fun.
""" name = "I Did Not Change The Name" @@ -128,7 +128,7 @@ class NetTestCase(unittest.TestCase):
optFlags = None optParameters = None - advancedOptParameters = None + usageOptions = None
requiresRoot = False
diff --git a/ooni/runner.py b/ooni/runner.py index 797a9d4..29ed831 100644 --- a/ooni/runner.py +++ b/ooni/runner.py @@ -42,7 +42,7 @@ def processTest(obj, cmd_line_options): raise Exception("This test requires root to run")
if obj.optParameters or input_file \ - or obj.advancedOptParameters or obj.optFlags: + or obj.usageOptions or obj.optFlags:
if not obj.optParameters: obj.optParameters = [] @@ -50,9 +50,9 @@ def processTest(obj, cmd_line_options): if input_file: obj.optParameters.append(input_file)
- if obj.advancedOptParameters: + if obj.usageOptions: log.debug("Got advanced options") - options = obj.advancedOptParameters() + options = obj.usageOptions() else: log.debug("Got optParameters") class Options(usage.Options):
tor-commits@lists.torproject.org