diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-08-08 13:53:28 -0500 |
---|---|---|
committer | Rodney Ewing <ewing.rj@gmail.com> | 2013-08-16 15:30:15 -0700 |
commit | e4bdc9091c392bf31d40bcb5ae12b92e17a6cb2a (patch) | |
tree | 01dfce440e0e1f7fc3ff8cb0a8199ebf84477644 /mediagoblin/processing/__init__.py | |
parent | 274a0f67fd9c36fe01950f2547425fb115c59aff (diff) | |
download | mediagoblin-e4bdc9091c392bf31d40bcb5ae12b92e17a6cb2a.tar.lz mediagoblin-e4bdc9091c392bf31d40bcb5ae12b92e17a6cb2a.tar.xz mediagoblin-e4bdc9091c392bf31d40bcb5ae12b92e17a6cb2a.zip |
More steps towards a working reprocessing system.
Fleshing out the base classes and setting up some docstrings. Not
everything is totally clear yet, but I think it's on a good track, and
getting clearer.
This commit sponsored by Ben Finney, on behalf of Free Software Melbourne.
Thank you all!
Diffstat (limited to 'mediagoblin/processing/__init__.py')
-rw-r--r-- | mediagoblin/processing/__init__.py | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py index 41028fbb..66ef2a53 100644 --- a/mediagoblin/processing/__init__.py +++ b/mediagoblin/processing/__init__.py @@ -114,6 +114,10 @@ class MediaProcessor(object): def __init__(self, manager): self.manager = manager + # Should be initialized at time of processing, at least + self.workbench = None + + # @with_workbench def process(self, **kwargs): """ Actually process this media entry. @@ -142,13 +146,12 @@ class MediaProcessor(object): class ProcessingManager(object): - """ - """ - def __init__(self, entry): - self.entry = entry - # May merge these two classes soon.... - self.state = ProcessingState(entry) + """Manages all the processing actions available for a media type + Specific processing actions, MediaProcessor subclasses, are added + to the ProcessingManager. + """ + def __init__(self): # Dict of all MediaProcessors of this media type self.processors = {} @@ -162,7 +165,7 @@ class ProcessingManager(object): self.processors[name] = processor - def list_eligible_processors(self): + def list_eligible_processors(self, entry): """ List all processors that this media entry is eligible to be processed for. @@ -170,9 +173,16 @@ class ProcessingManager(object): return [ processor for processor in self.processors.keys() - if processor.media_is_eligible(self.entry)] + if processor.media_is_eligible(entry)] + + def gen_process_request_via_cli(self, subparser): + # Got to figure out what actually goes here before I can write this properly + pass - def process(self, directive, request): + def process(self, entry, directive, request): + """ + Process a media entry. + """ pass |