diff options
m--------- | extlib/sandyseventiesspeedboat | 0 | ||||
-rw-r--r-- | mediagoblin/db/models.py | 16 | ||||
-rw-r--r-- | mediagoblin/media_types/raw_image/processing.py | 6 | ||||
-rw-r--r-- | mediagoblin/media_types/video/processing.py | 2 | ||||
-rw-r--r-- | setup.py | 1 |
5 files changed, 20 insertions, 5 deletions
diff --git a/extlib/sandyseventiesspeedboat b/extlib/sandyseventiesspeedboat -Subproject 994294e59a5248e29af4418903ce4fb40bd67be +Subproject 8873d9b559a4c5b3bb90997227d5455f8730fd4 diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index b910e522..2ff30d22 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -20,7 +20,6 @@ TODO: indexes on foreignkeys, where useful. import logging import datetime -import base64 from sqlalchemy import Column, Integer, Unicode, UnicodeText, DateTime, \ Boolean, ForeignKey, UniqueConstraint, PrimaryKeyConstraint, \ @@ -727,6 +726,14 @@ class Collection(Base, CollectionMixin): return CollectionItem.query.filter_by( collection=self.id).order_by(order_col) + def __repr__(self): + safe_title = self.title.encode('ascii', 'replace') + return '<{classname} #{id}: {title} by {creator}>'.format( + id=self.id, + classname=self.__class__.__name__, + creator=self.creator, + title=safe_title) + class CollectionItem(Base, CollectionItemMixin): __tablename__ = "core__collection_items" @@ -756,6 +763,13 @@ class CollectionItem(Base, CollectionItemMixin): """A dict like view on this object""" return DictReadAttrProxy(self) + def __repr__(self): + return '<{classname} #{id}: Entry {entry} in {collection}>'.format( + id=self.id, + classname=self.__class__.__name__, + collection=self.collection, + entry=self.media_entry) + class ProcessingMetaData(Base): __tablename__ = 'core__processing_metadata' diff --git a/mediagoblin/media_types/raw_image/processing.py b/mediagoblin/media_types/raw_image/processing.py index 83b01559..5ff54cf3 100644 --- a/mediagoblin/media_types/raw_image/processing.py +++ b/mediagoblin/media_types/raw_image/processing.py @@ -29,7 +29,7 @@ from mediagoblin.processing import ( _log = logging.getLogger(__name__) MEDIA_TYPE = 'mediagoblin.media_types.raw_image' -ACCEPTED_EXTENSIONS = ['nef',] +ACCEPTED_EXTENSIONS = ['nef', 'cr2'] # The entire function have to be copied @@ -67,8 +67,8 @@ class InitialRawProcessor(InitialProcessor): # Extract the biggest preview and write it as our working image md.previews[-1].write_to_file( self.process_filename.encode('utf-8')) - self.process_filename += ".jpg" - _log.debug('Wrote new file from {0} to preview (jpg) {1}'.format( + self.process_filename += '.jpg' + _log.debug(u'Wrote new file from {0} to preview (jpg) {1}'.format( self._original_raw, self.process_filename)) # Override the namebuilder with our new jpg-based name diff --git a/mediagoblin/media_types/video/processing.py b/mediagoblin/media_types/video/processing.py index c21c74b3..a7716592 100644 --- a/mediagoblin/media_types/video/processing.py +++ b/mediagoblin/media_types/video/processing.py @@ -44,7 +44,7 @@ class VideoTranscodingFail(BaseProcessingFail): general_message = _(u'Video transcoding failed') -EXCLUDED_EXTS = ["nef"] +EXCLUDED_EXTS = ["nef", "cr2"] def sniff_handler(media_file, filename): name, ext = os.path.splitext(filename) @@ -115,6 +115,7 @@ try: url="http://mediagoblin.org/", download_url="http://mediagoblin.org/download/", long_description=open(READMEFILE).read(), + description='MediaGoblin is a web application for publishing all kinds of media', classifiers=[ "Development Status :: 3 - Alpha", "Environment :: Web Environment", |