Merge "Make sure there is a default icon for swift index"

This commit is contained in:
Jenkins 2015-02-25 02:10:57 +00:00 committed by Gerrit Code Review
commit 1f3aea2e53
1 changed files with 5 additions and 2 deletions

View File

@ -32,6 +32,7 @@ DEBUG = True
# Map mime types to apache icons
APACHE_MIME_ICON_MAP = {
'_default': '/icons/unknown.png',
'application/gzip': '/icons/compressed.png',
'folder': '/icons/folder.png',
'text/html': '/icons/text.png',
@ -61,9 +62,11 @@ APACHE_MIME_ICON_MAP = {
def get_mime_icon(mime, filename=''):
if filename == '../':
if filename == '../' and filename in APACHE_MIME_ICON_MAP:
return APACHE_MIME_ICON_MAP[filename]
return APACHE_MIME_ICON_MAP[mime]
if mime in APACHE_MIME_ICON_MAP:
return APACHE_MIME_ICON_MAP[mime]
return APACHE_MIME_ICON_MAP['_default']
def generate_log_index(folder_links, header_message=''):