def load_object(path):
 try:
  dot = path.rindex('.')
 except ValueError:
  raise ValueError(("Error loading object '%s': not a full path" % path))
 (module, name) = (path[:dot], path[(dot + 1):])
 mod = import_module(module)
 try:
  obj = getattr(mod, name)
 except AttributeError:
  raise NameError(("Module '%s' doesn't define any object named '%s'" % (module, name)))
 return obj

def load_object ( path ) : try : dot = path . rindex ( '.' ) except ValueError : raise ValueError ( ( "Error loading object '%s': not a full path" % path ) ) ( module , name ) = ( path [ : dot ] , path [ ( dot + 1 ) : ] ) mod = import_module ( module ) try : obj = getattr ( mod , name ) except AttributeError : raise NameError ( ( "Module '%s' doesn't define any object named '%s'" % ( module , name ) ) ) return obj
load an object given its absolute object path .