aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/processing
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2013-01-26 15:28:24 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2013-02-08 10:09:37 +0100
commitfb46fa663dbd80a66a3a5995dfda730dd3fd52a4 (patch)
treebc2fd318ffcfc7ced1a6af3481ec23837e821675 /mediagoblin/processing
parent715ea495466a0dcebd1425dfd322775ff147aacd (diff)
downloadmediagoblin-fb46fa663dbd80a66a3a5995dfda730dd3fd52a4.tar.lz
mediagoblin-fb46fa663dbd80a66a3a5995dfda730dd3fd52a4.tar.xz
mediagoblin-fb46fa663dbd80a66a3a5995dfda730dd3fd52a4.zip
Kill monkeypatching of ProcessingState.
And change the process_foo() API to accept a processingstate now. image and video are tested, the others are UNTESTED.
Diffstat (limited to 'mediagoblin/processing')
-rw-r--r--mediagoblin/processing/__init__.py13
-rw-r--r--mediagoblin/processing/task.py2
2 files changed, 1 insertions, 14 deletions
diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py
index 28256107..f9445e28 100644
--- a/mediagoblin/processing/__init__.py
+++ b/mediagoblin/processing/__init__.py
@@ -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
diff --git a/mediagoblin/processing/task.py b/mediagoblin/processing/task.py
index 8614c673..aec50aab 100644
--- a/mediagoblin/processing/task.py
+++ b/mediagoblin/processing/task.py
@@ -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 ;)