Exemplo n.º 1
0
Arquivo: utils.py Projeto: 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)
Exemplo n.º 2
0
Arquivo: utils.py Projeto: 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