Enhance contenttype.py PEP8
This commit is contained in:
@@ -330,7 +330,7 @@ CONTENT_TYPE = {
|
|||||||
'.lha': 'application/x-lha',
|
'.lha': 'application/x-lha',
|
||||||
'.lhs': 'text/x-literate-haskell',
|
'.lhs': 'text/x-literate-haskell',
|
||||||
'.lhz': 'application/x-lhz',
|
'.lhz': 'application/x-lhz',
|
||||||
'.load' : 'text/html',
|
'.load': 'text/html',
|
||||||
'.log': 'text/x-log',
|
'.log': 'text/x-log',
|
||||||
'.lrz': 'application/x-lrzip',
|
'.lrz': 'application/x-lrzip',
|
||||||
'.ltx': 'text/x-tex',
|
'.ltx': 'text/x-tex',
|
||||||
@@ -823,7 +823,7 @@ CONTENT_TYPE = {
|
|||||||
'.xsd': 'application/xml',
|
'.xsd': 'application/xml',
|
||||||
'.xsl': 'application/xslt+xml',
|
'.xsl': 'application/xslt+xml',
|
||||||
'.xslfo': 'text/x-xslfo',
|
'.xslfo': 'text/x-xslfo',
|
||||||
'.xslm' : 'application/vnd.ms-excel.sheet.macroEnabled.12',
|
'.xslm': 'application/vnd.ms-excel.sheet.macroEnabled.12',
|
||||||
'.xslt': 'application/xslt+xml',
|
'.xslt': 'application/xslt+xml',
|
||||||
'.xspf': 'application/xspf+xml',
|
'.xspf': 'application/xspf+xml',
|
||||||
'.xul': 'application/vnd.mozilla.xul+xml',
|
'.xul': 'application/vnd.mozilla.xul+xml',
|
||||||
@@ -843,7 +843,7 @@ def contenttype(filename, default='text/plain'):
|
|||||||
"""
|
"""
|
||||||
Returns the Content-Type string matching extension of the given filename.
|
Returns the Content-Type string matching extension of the given filename.
|
||||||
"""
|
"""
|
||||||
filename=to_native(filename)
|
filename = to_native(filename)
|
||||||
i = filename.rfind('.')
|
i = filename.rfind('.')
|
||||||
if i >= 0:
|
if i >= 0:
|
||||||
default = CONTENT_TYPE.get(filename[i:].lower(), default)
|
default = CONTENT_TYPE.get(filename[i:].lower(), default)
|
||||||
|
|||||||
Reference in New Issue
Block a user