Also refactor "copy original into public storage".

This makes the processing code easier to read/write and
alos will help the reprocessing once we get to it.

Thanks to Joar Wandborg for testing!
This commit is contained in:
Elrond
2013-01-26 15:08:12 +01:00
parent bfd68cce85
commit 715ea49546
3 changed files with 8 additions and 7 deletions

View File

@@ -109,6 +109,12 @@ class ProcessingState(object):
self.queued_filename = queued_filename
return queued_filename
def copy_original(self, target_name, keyname=u"original"):
target_filepath = create_pub_filepath(self.entry, target_name)
mgg.public_store.copy_local_to_storage(self.get_queued_filename(),
target_filepath)
self.entry.media_files[keyname] = target_filepath
def delete_queue_file(self):
queued_filepath = self.entry.queued_media_file
mgg.queue_store.delete_file(queued_filepath)