commit 2320c69037cd16baa720ecfe5d1ca57f2be87340 Author: Isis Lovecruft isis@torproject.org Date: Thu Nov 1 08:48:16 2012 +0000
* Prevent all of the legacy plugins from auto-instantiating though getPlugin(). --- ooni/__init__.py | 21 +++++++++++---------- ooni/plugins/__init__.py | 6 +++--- ooni/plugins/blocking.py | 2 +- ooni/plugins/bridget.py | 2 +- ooni/plugins/chinatrigger.py | 2 +- ooni/plugins/daphn3.py | 2 +- ooni/plugins/dnstamper.py | 2 +- ooni/plugins/domclass.py | 2 +- ooni/plugins/tcpconnect.py | 2 +- 9 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/ooni/__init__.py b/ooni/__init__.py index 22ffb8b..e85436a 100644 --- a/ooni/__init__.py +++ b/ooni/__init__.py @@ -1,3 +1,11 @@ +__all__ = [ + 'config', 'inputunit', 'kit', + 'lib', 'nettest', 'oonicli', 'reporter', + 'runner', 'templates', 'utils', + ## XXX below are legacy related modules + 'ooniprobe', 'plugoo', 'plugins' + ] + from . import config from . import inputunit from . import kit @@ -9,14 +17,7 @@ from . import runner from . import templates from . import utils
-# XXX below are legacy related modules +## XXX below are legacy related modules #from . import ooniprobe -#from . import plugoo -#from . import plugins - -__all__ = ['config', 'inputunit', 'kit', - 'lib', 'nettest', 'oonicli', 'reporter', - 'runner', 'templates', 'utils', - # XXX below are legacy related modules - #'ooniprobe', 'plugoo', 'plugins' - ] +from . import plugoo +from . import plugins diff --git a/ooni/plugins/__init__.py b/ooni/plugins/__init__.py index ddb8691..129108c 100644 --- a/ooni/plugins/__init__.py +++ b/ooni/plugins/__init__.py @@ -1,3 +1,3 @@ -from twisted.plugin import pluginPackagePaths -__path__.extend(pluginPackagePaths(__name__)) -__all__ = [] +#from twisted.plugin import pluginPackagePaths +#__path__.extend(pluginPackagePaths(__name__)) +#__all__ = [] diff --git a/ooni/plugins/blocking.py b/ooni/plugins/blocking.py index f3c20e1..4dd2db1 100644 --- a/ooni/plugins/blocking.py +++ b/ooni/plugins/blocking.py @@ -43,4 +43,4 @@ class BlockingTest(OONITest):
# We need to instantiate it otherwise getPlugins does not detect it # XXX Find a way to load plugins without instantiating them. -blocking = BlockingTest(None, None, None) +#blocking = BlockingTest(None, None, None) diff --git a/ooni/plugins/bridget.py b/ooni/plugins/bridget.py index fcb60bb..5ff7b3f 100644 --- a/ooni/plugins/bridget.py +++ b/ooni/plugins/bridget.py @@ -484,7 +484,7 @@ class BridgetTest(OONITest): return self.d
## So that getPlugins() can register the Test: -bridget = BridgetTest(None, None, None) +#bridget = BridgetTest(None, None, None)
## ISIS' NOTES diff --git a/ooni/plugins/chinatrigger.py b/ooni/plugins/chinatrigger.py index 9873518..cf4bcb3 100644 --- a/ooni/plugins/chinatrigger.py +++ b/ooni/plugins/chinatrigger.py @@ -136,5 +136,5 @@ class ChinaTriggerTest(ScapyTest):
return {}
-chinatrigger = ChinaTriggerTest(None, None, None) +#chinatrigger = ChinaTriggerTest(None, None, None)
diff --git a/ooni/plugins/daphn3.py b/ooni/plugins/daphn3.py index de3df26..bf4d60d 100644 --- a/ooni/plugins/daphn3.py +++ b/ooni/plugins/daphn3.py @@ -149,4 +149,4 @@ class daphn3Test(OONITest):
# We need to instantiate it otherwise getPlugins does not detect it # XXX Find a way to load plugins without instantiating them. -daphn3test = daphn3Test(None, None, None) +#daphn3test = daphn3Test(None, None, None) diff --git a/ooni/plugins/dnstamper.py b/ooni/plugins/dnstamper.py index e762b6c..40df505 100644 --- a/ooni/plugins/dnstamper.py +++ b/ooni/plugins/dnstamper.py @@ -335,4 +335,4 @@ class DNSTamperTest(OONITest): 'control-address': ctrl_address, 'tampering-detected': False}
-dnstamper = DNSTamperTest(None, None, None) +#dnstamper = DNSTamperTest(None, None, None) diff --git a/ooni/plugins/domclass.py b/ooni/plugins/domclass.py index 38c03e4..3080c40 100644 --- a/ooni/plugins/domclass.py +++ b/ooni/plugins/domclass.py @@ -213,4 +213,4 @@ class domclassTest(HTTPTest): else: return {}
-domclass = domclassTest(None, None, None) +#domclass = domclassTest(None, None, None) diff --git a/ooni/plugins/tcpconnect.py b/ooni/plugins/tcpconnect.py index 6082979..7758a9e 100644 --- a/ooni/plugins/tcpconnect.py +++ b/ooni/plugins/tcpconnect.py @@ -62,4 +62,4 @@ class tcpconnectTest(OONITest):
# We need to instantiate it otherwise getPlugins does not detect it # XXX Find a way to load plugins without instantiating them. -tcpconnect = tcpconnectTest(None, None, None) +#tcpconnect = tcpconnectTest(None, None, None)
tor-commits@lists.torproject.org