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

@@ -16,7 +16,7 @@ from dynamic_search.api import register
from converter.api import get_page_count
from converter.api import get_available_transformations_choices
from converter.api import convert
from converter.exceptions import UnknownFormat, UnkownConvertError
from converter.exceptions import UnknownFileFormat, UnkownConvertError
from mimetype.api import get_document_mimetype, get_icon_file_path, \
get_error_icon_file_path
@@ -245,7 +245,7 @@ class Document(models.Model):
try:
image_cache_name = self.get_image_cache_name(page=page)
return convert(image_cache_name, cleanup_files=False, size=size, zoom=zoom, rotation=rotation)
except UnknownFormat:
except UnknownFileFormat:
return get_icon_file_path(self.file_mimetype)
except UnkownConvertError:
return get_error_icon_file_path()