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

[tor-commits] [ooni-probe/master] * Removed the optFlags from echo.py since they will not get parsed.



commit 98ab8e82f0637d870798280361bcfc7a484f0fc7
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Wed Oct 31 18:51:43 2012 +0000

    * Removed the optFlags from echo.py since they will not get parsed.
    * Added debug statement to reporter.
    * Fixed misnamed variables in nettest.py.
---
 ooni/echo.py     |    4 ++--
 ooni/reporter.py |    1 +
 ooni/runner.py   |   12 +++++-------
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/ooni/echo.py b/ooni/echo.py
index c5f4f47..c4ef588 100644
--- a/ooni/echo.py
+++ b/ooni/echo.py
@@ -59,9 +59,9 @@ class EchoTest(ScapyTest):
         ['size', 's', 56, 'Number of bytes to send in ICMP data field', int],
         ['ttl', 'l', 25, 'Set the IP Time to Live', int],
         ['timeout', 't', 2, 'Seconds until timeout if no response', int],
-        ['pcap', 'p', None, 'Save pcap to this file']
+        ['pcap', 'p', None, 'Save pcap to this file'],
+        ['receive', 'r', True, 'Receive response packets']
         ]
-    optFlags = [['receive', 'r', True, 'Receive response packets']]
 
     def setUpClass(self, *a, **kw):
         '''
diff --git a/ooni/reporter.py b/ooni/reporter.py
index 191708c..cedd016 100644
--- a/ooni/reporter.py
+++ b/ooni/reporter.py
@@ -179,6 +179,7 @@ class ReporterFactory(OReporter):
     def writeHeader(self):
         self.firstrun = False
         options = self.options
+        log.debug("reporter.ReporterFactory.writeHeader(): options = %s" % options)
         self._writeln("###########################################")
         self._writeln("# OONI Probe Report for %s test" % options['name'])
         self._writeln("# %s" % date.pretty_date())
diff --git a/ooni/runner.py b/ooni/runner.py
index 371f310..e35ee02 100644
--- a/ooni/runner.py
+++ b/ooni/runner.py
@@ -174,8 +174,8 @@ def loadTestsAndOptions(classes, config):
 
     _old_class_type = LegacyOONITest
 
-    for cls in classes:
-        if isinstance(cls, _old_class_type):
+    for klass in classes:
+        if isinstance(klass, _old_class_type):
             try:
                 cases = start_legacy_test(klass)
                 if cases:
@@ -187,7 +187,7 @@ def loadTestsAndOptions(classes, config):
                 log.err(e)
             else:
                 try:
-                    opts = cls.local_options
+                    opts = klass.local_options
                     options.append(opts)
                 except AttributeError, ae:
                     options.append([])
@@ -201,15 +201,13 @@ def loadTestsAndOptions(classes, config):
                 cases = makeTestCases(klass, tests, method_prefix)
                 test_cases.append(cases)
             try:
-                #c = cls()
-                #cls, opts = processTestOptions(cls, config)
-                opts = processTestOptions(cls, config)
+                opts = processTestOptions(klass, config)
             except AttributeError, ae:
                 options.append([])
                 log.err(ae)
             else:
                 try:
-                    instance = cls()
+                    instance = klass()
                     inputs = instance.__get_inputs__()
                 except Exception, e:
                     log.err(e)



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