def get_collectors_from_module(mod):
 for attrname in dir(mod):
  attr = getattr(mod, attrname)
  if (inspect.isclass(attr) and issubclass(attr, Collector) and (attr != Collector)):
   if attrname.startswith('parent_'):
    continue
   fqcn = '.'.join([mod.__name__, attrname])
   try:
    cls = load_dynamic_class(fqcn, Collector)
    (yield (cls.__name__, cls))
   except Exception:
    logger.error('Failed to load Collector: %s. %s', fqcn, traceback.format_exc())
    continue

def get_collectors_from_module ( mod ) : for attrname in dir ( mod ) : attr = getattr ( mod , attrname ) if ( inspect . isclass ( attr ) and issubclass ( attr , Collector ) and ( attr != Collector ) ) : if attrname . startswith ( 'parent_' ) : continue fqcn = '.' . join ( [ mod . __name__ , attrname ] ) try : cls = load_dynamic_class ( fqcn , Collector ) ( yield ( cls . __name__ , cls ) ) except Exception : logger . error ( 'Failed to load Collector: %s. %s' , fqcn , traceback . format_exc ( ) ) continue
locate all of the collector classes within a given module .