ProcessingState: Document monkey patching.
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Thu, 24 Jan 2013 09:23:38 +0000 (10:23 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Fri, 8 Feb 2013 09:09:37 +0000 (10:09 +0100)
mediagoblin/processing/__init__.py

index 738378b89717c18f58eda927d0327fa4707e9463..1760d0b93bc83581eefe29150bf4c0cd7053449f 100644 (file)
@@ -81,6 +81,16 @@ class ProcessingState(object):
         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):