@event(u'manager.startup')
def init_parsers(manager):
 for parser_type in PARSER_TYPES:
  parsers[parser_type] = {}
  for p in plugin.get_plugins(interface=(parser_type + u'_parser')):
   parsers[parser_type][p.name.replace(u'parser_', u'')] = p.instance
  func_name = (u'parse_' + parser_type)
  default_parsers[parser_type] = max(iter(parsers[parser_type].items()), key=(lambda p: getattr(getattr(p[1], func_name), u'priority', 0)))[0]
  log.debug((u'setting default %s parser to %s. (options: %s)' % (parser_type, default_parsers[parser_type], parsers[parser_type])))

@ event ( u'manager.startup' ) def init_parsers ( manager ) : for parser_type in PARSER_TYPES : parsers [ parser_type ] = { } for p in plugin . get_plugins ( interface = ( parser_type + u'_parser' ) ) : parsers [ parser_type ] [ p . name . replace ( u'parser_' , u'' ) ] = p . instance func_name = ( u'parse_' + parser_type ) default_parsers [ parser_type ] = max ( iter ( parsers [ parser_type ] . items ( ) ) , key = ( lambda p : getattr ( getattr ( p [ 1 ] , func_name ) , u'priority' , 0 ) ) ) [ 0 ] log . debug ( ( u'setting default %s parser to %s. (options: %s)' % ( parser_type , default_parsers [ parser_type ] , parsers [ parser_type ] ) ) )
prepare our list of parsing plugins and default parsers .