Kill monkeypatching of ProcessingState.
And change the process_foo() API to accept a processingstate now. image and video are tested, the others are UNTESTED.
This commit is contained in:
@@ -80,19 +80,6 @@ class ProcessingState(object):
|
||||
self.workbench = None
|
||||
self.queued_filename = None
|
||||
|
||||
# Monkey patch us onto the entry
|
||||
# This is needed to keep the current calling convention
|
||||
# for processors:
|
||||
# def process_FOO(entry):
|
||||
# proc_state = entry.proc_state
|
||||
# workbench = proc_state.workbench
|
||||
# When all processors use the new stuff, they should be
|
||||
# rewritten:
|
||||
# def process_FOO(proc_state):
|
||||
# entry = proc_state.entry
|
||||
# workbench = proc_state.workbench
|
||||
entry.proc_state = self
|
||||
|
||||
def set_workbench(self, wb):
|
||||
self.workbench = wb
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ class ProcessMedia(task.Task):
|
||||
with mgg.workbench_manager.create() as workbench:
|
||||
proc_state.set_workbench(workbench)
|
||||
# run the processing code
|
||||
entry.media_manager['processor'](entry)
|
||||
entry.media_manager['processor'](proc_state)
|
||||
|
||||
# We set the state to processed and save the entry here so there's
|
||||
# no need to save at the end of the processing stage, probably ;)
|
||||
|
||||
Reference in New Issue
Block a user