Fix formating
This commit is contained in:
parent
2af724e049
commit
71c0be6c83
1 changed files with 16 additions and 16 deletions
|
@ -3,34 +3,34 @@ from django import template
|
|||
register = template.Library()
|
||||
|
||||
@register.filter
|
||||
def is_image (mime_type):
|
||||
'''
|
||||
def is_image(mime_type):
|
||||
"""
|
||||
A function that takes the mime type as input and returns true if it is an image
|
||||
'''
|
||||
return mime_type.startswith('image/')
|
||||
"""
|
||||
return mime_type.startswith("image/")
|
||||
|
||||
|
||||
@register.filter
|
||||
def is_video (mime_type):
|
||||
'''
|
||||
def is_video(mime_type):
|
||||
"""
|
||||
A function that takes the mime type as input and returns true if it is an video
|
||||
'''
|
||||
return mime_type.startswith('video/')
|
||||
"""
|
||||
return mime_type.startswith("video/")
|
||||
|
||||
|
||||
@register.filter
|
||||
def is_flash (mime_type):
|
||||
'''
|
||||
def is_flash(mime_type):
|
||||
"""
|
||||
A function that takes the mime type as input and returns true if it is an flash
|
||||
'''
|
||||
"""
|
||||
|
||||
valid_flash_mime_types = [
|
||||
'application/vnd.adobe.flash.movie',
|
||||
'application/x-shockwave-flash',
|
||||
'application/futuresplash',
|
||||
'application/x-swf',
|
||||
"application/vnd.adobe.flash.movie",
|
||||
"application/x-shockwave-flash",
|
||||
"application/futuresplash",
|
||||
"application/x-swf",
|
||||
]
|
||||
|
||||
|
||||
for valid_type in valid_flash_mime_types:
|
||||
if valid_type in mime_type:
|
||||
return True
|
||||
|
|
Loading…
Reference in a new issue