Image media exceptions

- Removed exception types specified in image.processing and included them from process_media.errors instead
This commit is contained in:
Joar Wandborg 2011-10-15 19:16:02 +02:00
parent 363d774eea
commit 959b0df398

View File

@ -24,6 +24,8 @@ from mediagoblin import mg_globals as mgg
from mediagoblin.util import lazy_pass_to_ugettext as _
from mediagoblin.process_media.errors import *
THUMB_SIZE = 180, 180
MEDIUM_SIZE = 640, 640
@ -34,35 +36,6 @@ def create_pub_filepath(entry, filename):
unicode(entry['_id']),
filename])
class BaseProcessingFail(Exception):
"""
Base exception that all other processing failure messages should
subclass from.
You shouldn't call this itself; instead you should subclass it
and provid the exception_path and general_message applicable to
this error.
"""
general_message = u''
@property
def exception_path(self):
return u"%s:%s" % (
self.__class__.__module__, self.__class__.__name__)
def __init__(self, **metadata):
self.metadata = metadata or {}
class BadMediaFail(BaseProcessingFail):
"""
Error that should be raised when an inappropriate file was given
for the media type specified.
"""
general_message = _(u'Invalid file given for media type.')
################################
# Media processing initial steps
################################