diff options
author | Joar Wandborg <git@wandborg.com> | 2012-07-10 17:53:37 +0200 |
---|---|---|
committer | Joar Wandborg <git@wandborg.com> | 2012-07-10 18:13:02 +0200 |
commit | 51eb0267d901bafcc90879dadbc2b8616ecdc4f5 (patch) | |
tree | 864566efd685a1680a3a1f1445bc9bd158454794 /mediagoblin/processing/task.py | |
parent | 81d3c4cf1cee923c4b803a96b6f5628e9aa9b78d (diff) | |
download | mediagoblin-51eb0267d901bafcc90879dadbc2b8616ecdc4f5.tar.lz mediagoblin-51eb0267d901bafcc90879dadbc2b8616ecdc4f5.tar.xz mediagoblin-51eb0267d901bafcc90879dadbc2b8616ecdc4f5.zip |
Minor improvements to the processing panel
- It is now possible to actually see what's processing, due to a bug fix
where __getitem__ was called on the db model.
- Removed DEPRECATED message from the docstring, it wasn't true.
Diffstat (limited to 'mediagoblin/processing/task.py')
-rw-r--r-- | mediagoblin/processing/task.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/mediagoblin/processing/task.py b/mediagoblin/processing/task.py index 901d293b..af815362 100644 --- a/mediagoblin/processing/task.py +++ b/mediagoblin/processing/task.py @@ -24,6 +24,8 @@ from mediagoblin.media_types import get_media_manager from mediagoblin.processing import mark_entry_failed, BaseProcessingFail _log = logging.getLogger(__name__) +logging.basicConfig() +_log.setLevel(logging.DEBUG) ################################ @@ -32,8 +34,6 @@ _log = logging.getLogger(__name__) class ProcessMedia(Task): """ - DEPRECATED -- This now resides in the individual media plugins - Pass this entry off for processing. """ def run(self, media_id): @@ -44,16 +44,21 @@ class ProcessMedia(Task): entry = mgg.database.MediaEntry.one( {'_id': ObjectId(media_id)}) + _log.info('Running task {0} on media {1}: {2}'.format( + self.name, + entry._id, + entry.title)) + # Try to process, and handle expected errors. try: #__import__(entry.media_type) manager = get_media_manager(entry.media_type) _log.debug('Processing {0}'.format(entry)) manager['processor'](entry) - except BaseProcessingFail, exc: + except BaseProcessingFail as exc: mark_entry_failed(entry._id, exc) return - except ImportError, exc: + except ImportError as exc: _log.error( 'Entry {0} failed to process due to an import error: {1}'\ .format( |