def safe_import(module_name, class_name):
 if (type(class_name) is list):
  for name in class_name:
   safe_import(module_name, name)
  return
 package = __package__
 if (not package):
  package = __name__
 try:
  module = importlib.import_module(module_name, package)
  globals()[class_name] = getattr(module, class_name)
 except ImportError as error:
  logger.warning("Unmet dependencies for optional Widget: '%s.%s', %s", module_name, class_name, error)
  logger.debug('%s', traceback.format_exc())

def safe_import ( module_name , class_name ) : if ( type ( class_name ) is list ) : for name in class_name : safe_import ( module_name , name ) return package = __package__ if ( not package ) : package = __name__ try : module = importlib . import_module ( module_name , package ) globals ( ) [ class_name ] = getattr ( module , class_name ) except ImportError as error : logger . warning ( "Unmet dependencies for optional Widget: '%s.%s', %s" , module_name , class_name , error ) logger . debug ( '%s' , traceback . format_exc ( ) )
try to import a module .