[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [ooni-probe/master] Take an instance rather than class
commit 4aad9aae0d56b57277c8dca4b1781f32899bebd0
Author: aagbsn <aagbsn@xxxxxxxx>
Date: Wed Sep 18 16:21:11 2013 +0200
Take an instance rather than class
Measurements should be able to take an instanced class so that the
resulting report can be shared between several Measurements.
---
ooni/tasks.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ooni/tasks.py b/ooni/tasks.py
index baefb51..52e9164 100644
--- a/ooni/tasks.py
+++ b/ooni/tasks.py
@@ -106,9 +106,10 @@ class Measurement(TaskWithTimeout):
net_test:
a reference to the net_test object such measurement belongs to.
"""
- self.testInstance = test_class()
+ self.testInstance = test_class
self.testInstance.input = test_input
- self.testInstance.report = {'input': test_input}
+ if not self.testInstance.report:
+ self.testInstance.report = {'input': test_input}
self.testInstance._start_time = time.time()
self.testInstance._setUp()
self.testInstance.setUp()
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits