def dynamic_class_import(class_path):
 try:
  tmp = class_path.split('.')
  module_path = '.'.join(tmp[0:(-1)])
  package = __import__(module_path)
  return reduce(getattr, tmp[1:], package)
 except Exception as e:
  log.error(LOGMSG_ERR_FAB_ADDON_IMPORT.format(class_path, e))

def dynamic_class_import ( class_path ) : try : tmp = class_path . split ( '.' ) module_path = '.' . join ( tmp [ 0 : ( - 1 ) ] ) package = __import__ ( module_path ) return reduce ( getattr , tmp [ 1 : ] , package ) except Exception as e : log . error ( LOGMSG_ERR_FAB_ADDON_IMPORT . format ( class_path , e ) )
will dynamically import a class from a string path .