Example #1
0
File: utils.py Project: flynx/pli
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)
Example #2
0
File: utils.py Project: flynx/pli
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