Permalink
Browse files

SynchronousResult should only care about the result not running behavior

  • Loading branch information...
1 parent 624831f commit d548b257bb3d3e51a9605e1c7d3e4e8b0ff88523 @brosner brosner committed Apr 13, 2010
Showing with 5 additions and 9 deletions.
  1. +5 −9 contacts_import/backends/runners.py
@@ -19,23 +19,19 @@ class SynchronousResult(object):
Very simple result to mimic what is needed of Celery's result
"""
- def __init__(self, importer, *args):
- self.importer = importer
- self.args = args
+ def __init__(self, result):
+ self.result = result
self.status = "DONE"
- def run(self):
- self.result = self.importer().run(*self.args)
-
def ready(self):
return True
class SynchronousRunner(BaseRunner):
def import_contacts(self):
- result = SynchronousResult(self.importer, self.credentials, self.persistance())
- result.run()
- return result
+ return SynchronousResult(
+ self.importer().run(self.credentials, self.persistance())
+ )
class AsyncRunner(BaseRunner):

0 comments on commit d548b25

Please sign in to comment.