diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-08-09 17:30:52 -0500 |
---|---|---|
committer | Rodney Ewing <ewing.rj@gmail.com> | 2013-08-16 15:30:16 -0700 |
commit | d1e9913b71a6f3b7bb41f5eee1051093b92fcd8a (patch) | |
tree | c4ad9e59611368258b0a6f25306a0c927621c87c /mediagoblin/processing | |
parent | 4ba5bdd96ef3703d8da216ca3dd92f080214f164 (diff) | |
download | mediagoblin-d1e9913b71a6f3b7bb41f5eee1051093b92fcd8a.tar.lz mediagoblin-d1e9913b71a6f3b7bb41f5eee1051093b92fcd8a.tar.xz mediagoblin-d1e9913b71a6f3b7bb41f5eee1051093b92fcd8a.zip |
Should be enough to get to the point where you can actually initialize a processing command now.
However, it doesn't celery task-ify it...
This commit sponsored by Catalin Cosovanu. Thank you!
Diffstat (limited to 'mediagoblin/processing')
-rw-r--r-- | mediagoblin/processing/__init__.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py index 6ef203cb..1c8f7202 100644 --- a/mediagoblin/processing/__init__.py +++ b/mediagoblin/processing/__init__.py @@ -112,8 +112,9 @@ class MediaProcessor(object): # action this MediaProcessor provides description = None - def __init__(self, manager): + def __init__(self, manager, media_entry): self.manager = manager + self.media_entry = media_entry # Should be initialized at time of processing, at least self.workbench = None @@ -138,7 +139,7 @@ class MediaProcessor(object): raise NotImplementedError @classmethod - def parser_to_request(cls, parser): + def args_to_request(cls, args): raise NotImplementedError ########################################## @@ -214,6 +215,17 @@ class ProcessingManager(object): pass +def request_from_args(args, which_args): + """ + Generate a request from the values of some argparse parsed args + """ + request = {} + for arg in which_args: + request[arg] = getattr(args, arg) + + return request + + class ProcessingState(object): """ The first and only argument to the "processor" of a media type |