Update mimetype app for the new icon API

This commit is contained in:
Roberto Rosario
2012-09-13 17:11:17 -04:00
parent 61730878e4
commit 784467969a
2 changed files with 16 additions and 16 deletions

View File

@@ -69,23 +69,23 @@ mimetype_icons = {
}
def get_icon_file_path(mimetype):
file_name = mimetype_icons.get(mimetype, UNKNWON_TYPE_FILE_NAME)
if settings.DEVELOPMENT:
return os.path.join(settings.PROJECT_ROOT, 'apps', 'mimetype', 'static', MIMETYPE_ICONS_DIRECTORY_NAME, file_name)
else:
return os.path.join(settings.STATIC_ROOT, MIMETYPE_ICONS_DIRECTORY_NAME, file_name)
#def get_icon_file_path(mimetype):
# file_name = mimetype_icons.get(mimetype, UNKNWON_TYPE_FILE_NAME)
# if settings.DEVELOPMENT:
# return os.path.join(settings.PROJECT_ROOT, 'apps', 'mimetype', 'static', MIMETYPE_ICONS_DIRECTORY_NAME, file_name)
# else:
# return os.path.join(settings.STATIC_ROOT, MIMETYPE_ICONS_DIRECTORY_NAME, file_name)
def get_error_icon_file_path():
if settings.DEVELOPMENT:
return os.path.join(settings.PROJECT_ROOT, 'apps', 'mimetype', 'static', MIMETYPE_ICONS_DIRECTORY_NAME, ERROR_FILE_NAME)
else:
return os.path.join(settings.STATIC_ROOT, MIMETYPE_ICONS_DIRECTORY_NAME, ERROR_FILE_NAME)
#def get_error_icon_file_path():
# if settings.DEVELOPMENT:
# return os.path.join(settings.PROJECT_ROOT, 'apps', 'mimetype', 'static', MIMETYPE_ICONS_DIRECTORY_NAME, ERROR_FILE_NAME)
# else:
# return os.path.join(settings.STATIC_ROOT, MIMETYPE_ICONS_DIRECTORY_NAME, ERROR_FILE_NAME)
def get_error_icon_url():
return os.path.join(MIMETYPE_ICONS_DIRECTORY_NAME, ERROR_FILE_NAME)
#def get_error_icon_url():
# return os.path.join(MIMETYPE_ICONS_DIRECTORY_NAME, ERROR_FILE_NAME)
def get_mimetype(file_description, filepath, mimetype_only=False):

View File

@@ -1,7 +1,7 @@
from __future__ import absolute_import
from icons.literals import FILE_EXTENSION_ERROR, FILE_EXTENSION_UNKNOWN, ICON_SET_CUSTOM
from icons.literals import FILE_EXTENSION_ERROR, FILE_EXTENSION_UNKNOWN
from icons import Icon
icon_file_extension_error = Icon(FILE_EXTENSION_ERROR, ICON_SET_CUSTOM)
icon_file_extension_unknown = Icon(FILE_EXTENSION_UNKNOWN, ICON_SET_CUSTOM)
icon_file_extension_error = Icon(FILE_EXTENSION_ERROR, 'custom')
icon_file_extension_unknown = Icon(FILE_EXTENSION_UNKNOWN, 'custom')