def __contains__(self, i):
return (i in self.mm_dict)
- def get(self, *args, **kwargs):
- return self.mm_dict.get(*args, **kwargs)
+ @property
+ def media_fetch_order(self):
+ return self.mm_dict.get('media_fetch_order')
def __getattr__(self, i):
return self.mm_dict[i]
for media_type, manager in get_media_managers():
_log.info('Sniffing {0}'.format(media_type))
if 'sniff_handler' in manager and \
- manager['sniff_handler'](media_file, media=media):
+ manager.sniff_handler(media_file, media=media):
_log.info('{0} accepts the file'.format(media_type))
return media_type, manager
else:
for media_type, manager in get_media_managers():
# Omit the dot from the extension and match it against
# the media manager
- if ext[1:] in manager['accepted_extensions']:
+ if ext[1:] in manager.accepted_extensions:
return media_type, manager
else:
_log.info('File {0} has no file extension, let\'s hope the sniffers get it.'.format(
with mgg.workbench_manager.create() as workbench:
proc_state.set_workbench(workbench)
# run the processing code
- entry.media_manager['processor'](proc_state)
+ entry.media_manager.processor(proc_state)
# We set the state to processed and save the entry here so there's
# no need to save at the end of the processing stage, probably ;)