Renamed the exception UnknownFormat to UnkownFileFormat and updated all

backends get_page_count method to raise it, having the api's get_page_count
function decide how to handle the exception
This commit is contained in:
Roberto Rosario
2011-08-05 03:24:01 -04:00
parent eaea853391
commit cd0b1577a7
7 changed files with 25 additions and 25 deletions

View File

@@ -10,7 +10,7 @@ from django.utils.translation import ugettext_lazy as _
from mimetype.api import get_icon_file_path, get_error_icon_file_path, \
get_mimetype
from converter.api import convert, cache_cleanup
from converter.exceptions import UnknownFormat, UnkownConvertError
from converter.exceptions import UnknownFileFormat, UnkownConvertError
DEFAULT_STAGING_DIRECTORY = u'/tmp'
@@ -138,7 +138,7 @@ class StagingFile(object):
def get_image(self, size, transformations):
try:
return convert(self.filepath, size=size, cleanup_files=False, transformations=transformations)
except UnknownFormat:
except UnknownFileFormat:
return get_icon_file_path(get_mimetype(self.filepath))
except UnkownConvertError:
return get_error_icon_file_path()