projects
/
mediagoblin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
443dcf8
)
Allow media managers without sniff_handler
author
Joar Wandborg
<joar@wandborg.se>
Tue, 26 Feb 2013 22:57:20 +0000
(23:57 +0100)
committer
Joar Wandborg
<joar@wandborg.se>
Tue, 26 Feb 2013 23:30:51 +0000
(
00:30
+0100)
mediagoblin/media_types/__init__.py
patch
|
blob
|
blame
|
history
diff --git
a/mediagoblin/media_types/__init__.py
b/mediagoblin/media_types/__init__.py
index 0676351053eb0af8e658cf32337a3f8c139eb6a0..0abb38d3ada5f8b686d61feea27ab97fd03c274a 100644
(file)
--- a/
mediagoblin/media_types/__init__.py
+++ b/
mediagoblin/media_types/__init__.py
@@
-49,7
+49,8
@@
def sniff_media(media):
for media_type, manager in get_media_managers():
_log.info('Sniffing {0}'.format(media_type))
- if manager['sniff_handler'](media_file, media=media):
+ if 'sniff_handler' in manager and \
+ manager['sniff_handler'](media_file, media=media):
_log.info('{0} accepts the file'.format(media_type))
return media_type, manager
else: