commit bcf5e79efcc8273a424a6bc668e0b5d6b21f0b0a Author: Arturo Filastò art@torproject.org Date: Mon Jul 9 12:01:12 2012 +0200
Remove dead code. --- ooni/plugoo/work.py | 81 --------------------------------------------------- 1 files changed, 0 insertions(+), 81 deletions(-)
diff --git a/ooni/plugoo/work.py b/ooni/plugoo/work.py index a3fb168..fc338d7 100644 --- a/ooni/plugoo/work.py +++ b/ooni/plugoo/work.py @@ -107,84 +107,3 @@ class WorkGenerator(object): self.idx += 1 return (ret, self.Test, self.idx)
- def p_next(self): - """ - XXX This is not used for KISS sake. - """ - if self.end: - raise StopIteration - - if not self.assetGenerator: - self.end = True - return WorkUnit(None, self.assetNames, self.Test, self.idx) - - # Plank asset - p_asset = [] - for i in xrange(0, self.size): - try: - asset = self.assetGenerator.next() - p_asset.append(asset) - print p_asset - except StopIteration: - if self.asset_num > 1: - pass - self.end = True - break - - self.idx += 1 - return WorkUnit(p_asset, self.assetNames, self.Test, self.idx) - -class WorkUnit(object): - """ - XXX This is currently not implemented for KISS sake. - - This is an object responsible for completing WorkUnits it will - return its result in a deferred. - - The execution of a unit of work should be Atomic. - - Reporting to the OONI-net happens on completion of a Unit of Work. - - @Node node: This represents the node associated with the Work Unit - @Asset asset: This is the asset associated with the Work Unit - @Test test: This represents the Test to be with the specified assets - @ivar arguments: These are the extra attributes to be passsed to the Test - """ - - node = None - asset = None - test = None - arguments = None - - def __init__(self, asset, assetNames, test, idx): - self.asset = asset - if not asset: - self.assetGenerator = iter([1]) - else: - self.assetGenerator = iter(asset) - self.Test = test - self.assetNames = assetNames - self.idx = idx - - def __iter__(self): - return self - - def __repr__(self): - return "<WorkUnit %s %s %s>" % (self.assetNames, self.Test, self.idx) - - def serialize(self): - """ - Serialize this unit of work for RPC activity. - """ - return yaml.dump(self) - - def next(self): - """ - Launches the Unit of Work with the specified assets on the node. - """ - try: - asset = self.assetGenerator.next() - ret = self.Test.set_asset(asset) - return ret - except StopIteration: - raise StopIteration
tor-commits@lists.torproject.org