def getattr(obj, name, uid=None): """ """ if isaccessible(obj) and _hasattr(obj, name) and interface.isreadable(obj, name): o_obj = _getattr(obj, name) if isaccessible(o_obj): return o_obj raise AttributeError, '"%s" object has no attribute "%s".' % (obj, name)
def hasattr(obj, name, uid=None): """ """ if isaccessible(obj) and _hasattr(obj, name) and interface.isreadable(obj, name): o_obj = getattr(obj, name) if isaccessible(o_obj): return True return False