Merge branch 'video_gstreamer-only'
authorJoar Wandborg <git@wandborg.com>
Mon, 21 Nov 2011 20:51:30 +0000 (21:51 +0100)
committerJoar Wandborg <git@wandborg.com>
Mon, 21 Nov 2011 20:51:30 +0000 (21:51 +0100)
Conflicts:
mediagoblin/db/migrations.py
mediagoblin/submit/views.py

12 files changed:
1  2 
mediagoblin/db/migrations.py
mediagoblin/gmg_commands/import_export.py
mediagoblin/init/celery/__init__.py
mediagoblin/process_media/__init__.py
mediagoblin/storage/cloudfiles.py
mediagoblin/submit/views.py
mediagoblin/templates/mediagoblin/base.html
mediagoblin/templates/mediagoblin/user_pages/media.html
mediagoblin/user_pages/views.py
mediagoblin/views.py
mediagoblin/workbench.py
setup.py

index edaf56306670581027f998403ed13870efae79e5,01df72081c0d18214d8e77d8d7f78399ee0bacd1..cfc012871b738a82d6374b2295b67554ce4ed22c
@@@ -98,5 -99,19 +98,13 @@@ def user_add_forgot_password_token_and_
      """
      Add token and expiration fields to help recover forgotten passwords
      """
 -    database['users'].update(
 -        {'fp_verification_key': {'$exists': False}},
 -        {'$set': {'fp_verification_key': None}},
 -        multi=True)
 -    database['users'].update(
 -         {'fp_token_expire': {'$exists': False}},
 -         {'$set': {'fp_token_expire': None}},
 -         multi=True)
 +    add_table_field(database, 'users', 'fp_verification_key', None)
 +    add_table_field(database, 'users', 'fp_token_expire', None)
+ @RegisterMigration(7)
+ def media_type_image_to_multimedia_type_image(database):
+     database['media_entries'].update(
+         {'media_type': 'image'},
+         {'$set': {'media_type': 'mediagoblin.media_types.image'}},
+         multi=True)
index 30112969aa2642bd049b9e2d9cb387717d2ecbf1,fefbdb4eac811a5c571e25cdea6409cb74254a3f..4ec17d4783d2df046ee785398d635605595f83c3
@@@ -208,13 -212,15 +208,15 @@@ def _export_media(db, args)
  
      for entry in db.media_entries.find():
          for name, path in entry['media_files'].items():
 -            _log.info('Exporting {0} - {1}'.format(
 +            _log.info(u'Exporting {0} - {1}'.format(
                      entry['title'],
                      name))
-             mc_file = media_cache.get_file(path, mode='wb')
-             mc_file.write(
-                 mg_globals.public_store.get_file(path, mode='rb').read())
+             try:
+                 mc_file = media_cache.get_file(path, mode='wb')
+                 mc_file.write(
+                     mg_globals.public_store.get_file(path, mode='rb').read())
+             except e:
+                 _log.error('Failed: {0}'.format(e))
  
      _log.info('...Media exported')
  
Simple merge
index 54c0c493d97d9e4f21f55cc51bedccdd51693a81,96fe49fe62bbccd0f3b28e0d2dbf71e5cac380f3..346bb47953fe8d52b479becdc68496c6b17a8789
@@@ -54,10 -53,13 +54,13 @@@ class ProcessMedia(Task)
  
          # Try to process, and handle expected errors.
          try:
+             __import__(entry['media_type'])
              process_image(entry)
          except BaseProcessingFail, exc:
 -            mark_entry_failed(entry[u'_id'], exc)
 +            mark_entry_failed(entry._id, exc)
              return
+         except ImportError, exc:
+             mark_entry_failed(entry[u'_id'], exc)
  
          entry['state'] = u'processed'
          entry.save()
Simple merge
index 139b1d1d53ac33531f00b87b280134fcd3ee3f34,78f52160aa02c8ff67896ac9e3128c382ea596a8..dd1c3d1bc05910a365db150b26b18e3df4783019
@@@ -22,13 -22,15 +22,14 @@@ from cgi import FieldStorag
  from werkzeug.utils import secure_filename
  
  from mediagoblin.db.util import ObjectId
 -from mediagoblin.util import (
 -    render_to_response, redirect, cleaned_markdown_conversion, \
 -    convert_to_tag_list_of_dicts)
 -from mediagoblin.util import pass_to_ugettext as _
 +from mediagoblin.tools.text import cleaned_markdown_conversion, convert_to_tag_list_of_dicts
 +from mediagoblin.tools.translate import pass_to_ugettext as _
 +from mediagoblin.tools.response import render_to_response, redirect
  from mediagoblin.decorators import require_active_login
  from mediagoblin.submit import forms as submit_forms, security
- from mediagoblin.process_media import process_media, mark_entry_failed
+ from mediagoblin.process_media import mark_entry_failed
  from mediagoblin.messages import add_message, SUCCESS
+ from mediagoblin.media_types import get_media_type_and_manager
  
  
  @require_active_login
@@@ -104,8 -104,8 +105,8 @@@ def submit_start(request)
              # (... don't change entry after this point to avoid race
              # conditions with changes to the document via processing code)
              try:
-                 process_media.apply_async(
+                 media_manager['processor'].apply_async(
 -                    [unicode(entry['_id'])], {},
 +                    [unicode(entry._id)], {},
                      task_id=task_id)
              except BaseException as exc:
                  # The purpose of this section is because when running in "lazy"
Simple merge
index ecf5b7239b6d8109014647185033eefd2c5474af,c2e3e80a66474e5a714f6df60883daca1d037f22..cd6aba9b8fdc6a6608ee51ef63376193b96ffab8
  # You should have received a copy of the GNU Affero General Public License
  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
  
+ import sys
  from mediagoblin import mg_globals
 -from mediagoblin.util import render_to_response, Pagination
 +from mediagoblin.tools.pagination import Pagination
 +from mediagoblin.tools.response import render_to_response
  from mediagoblin.db.util import DESCENDING
  from mediagoblin.decorators import uses_pagination
+ from mediagoblin import media_types
  
 +
  @uses_pagination
  def root_view(request, page):
      cursor = request.db.MediaEntry.find(
index 60a79f470aace36f0b69c1a881d8fbffa3c29293,b5e8eac5ad0abcc5ed045c69bf1d8be7152af08e..9578494c8ae297248432996d728740bddaea333b
@@@ -42,12 -42,13 +42,15 @@@ class Workbench(object)
  
      def __unicode__(self):
          return unicode(self.dir)
 +
      def __str__(self):
          return str(self.dir)
 +
      def __repr__(self):
-         return repr(self.dir)
+         try:
+             return str(self)
+         except AttributeError:
+             return 'None'
  
      def joinpath(self, *args):
          return os.path.join(self.dir, *args)
diff --cc setup.py
index 7333f974782c8d9be310353e38c0ea778c0f397a,ccd1f653f80e393cce954488d3977ae2727262cc..c3c2f86f5fd1c6503a147f29d8e14a90292a8144
+++ b/setup.py
@@@ -66,8 -65,9 +66,9 @@@ setup
          ## their package managers.
          # 'lxml',
          ],
+     requires=['gst'],
      test_suite='nose.collector',
 -    entry_points = """\
 +    entry_points="""\
          [console_scripts]
          gmg = mediagoblin.gmg_commands:main_cli
          pybabel = mediagoblin.babel.messages.frontend:main