Fixes for video branch
authorJoar Wandborg <git@wandborg.com>
Tue, 22 Nov 2011 20:06:08 +0000 (21:06 +0100)
committerJoar Wandborg <git@wandborg.com>
Tue, 22 Nov 2011 20:06:08 +0000 (21:06 +0100)
- Removed superfluous code from media_types.image
- Updated lazy_pass_to_ugettext imports

mediagoblin/media_types/__init__.py
mediagoblin/media_types/image/processing.py
mediagoblin/media_types/video/transcoders.py
mediagoblin/processing.py

index a2ea6bcb9477132ddb8bb3fe594e43e1045ccb10..f56fd942519ee59aaab8bd03182e85a20f91f05d 100644 (file)
@@ -18,7 +18,7 @@ import os
 import sys
 
 from mediagoblin import mg_globals
-from mediagoblin.util import lazy_pass_to_ugettext as _
+from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
 
 
 class FileTypeNotSupported(Exception):
@@ -49,13 +49,7 @@ def get_media_managers():
     Generator that returns all available media managers
     '''
     for media_type in get_media_types():
-        try:
-            __import__(media_type)
-        except ImportError as e:
-            raise Exception(
-                _('ERROR: Could not import {media_type}: {exception}').format(
-                    media_type=media_type,
-                    exception=e))
+        __import__(media_type)
             
         yield media_type, sys.modules[media_type].MEDIA_MANAGER
 
index 5e8e4e0a75897d65123bb227aee26a8c0a7e9fb4..2932c45581a68d7eef662b7b06ed54791383c571 100644 (file)
@@ -31,42 +31,6 @@ from mediagoblin.processing import BaseProcessingFail, \
 # Media processing initial steps
 ################################
 
-class ProcessMedia(Task):
-    """
-    Pass this entry off for processing.
-    """
-    def run(self, media_id):
-        """
-        Pass the media entry off to the appropriate processing function
-        (for now just process_image...)
-        """
-        entry = mgg.database.MediaEntry.one(
-            {'_id': ObjectId(media_id)})
-
-        # Try to process, and handle expected errors.
-        try:
-            process_image(entry)
-        except BaseProcessingFail, exc:
-            mark_entry_failed(entry[u'_id'], exc)
-            return
-
-        entry['state'] = u'processed'
-        entry.save()
-
-    def on_failure(self, exc, task_id, args, kwargs, einfo):
-        """
-        If the processing failed we should mark that in the database.
-
-        Assuming that the exception raised is a subclass of BaseProcessingFail,
-        we can use that to get more information about the failure and store that
-        for conveying information to users about the failure, etc.
-        """
-        entry_id = args[0]
-        mark_entry_failed(entry_id, exc)
-
-
-process_media = registry.tasks[ProcessMedia.name]
-
 
 def process_image(entry):
     """
index 493a837fa25c0d1625651daeedc501ebe2e63d12..d7ed14cad25633971d867e2d6a3a318234a9087f 100644 (file)
@@ -94,8 +94,8 @@ class VideoThumbnailer:
         self.videosink = gst.element_factory_make('fakesink', 'videosink')
         self.playbin.set_property('video-sink', self.videosink)
 
-        #self.audiosink = gst.element_factory_make('fakesink', 'audiosink')
-        #self.playbin.set_property('audio-sink', self.audiosink)
+        self.audiosink = gst.element_factory_make('fakesink', 'audiosink')
+        self.playbin.set_property('audio-sink', self.audiosink)
 
         self.bus = self.playbin.get_bus()
         self.bus.add_signal_watch()
index 8738cbe2923b64540f720b034d77a7f27a8f5d0a..89c4ac89f190a4cadecf468f12a1eb6558481cdf 100644 (file)
@@ -19,7 +19,7 @@ from celery.task import Task
 from mediagoblin.db.util import ObjectId
 from mediagoblin import mg_globals as mgg
 
-from mediagoblin.util import lazy_pass_to_ugettext as _
+from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
 
 from mediagoblin.media_types import get_media_manager