(obj, keypath)
return cur
Get the value for the keypath. Keypath is a string containing a
    path of keys, path elements are seperated by dots.
Get the value for the keypath. Keypath is a string containing a
    path of keys, path elements are seperated by dots.
Get the value for the keypath . Keypath is a string containing a path of keys path elements are seperated by dots .
def getKeyPath(obj, keypath):
    """
    Get the value for the keypath. Keypath is a string containing a
    path of keys, path elements are seperated by dots.
    """
    if not keypath:
        raise KeyError

    if obj is None:
        return None


    if isinstance(obj, (objc.objc_object, objc.objc_class)):
        return obj.valueForKeyPath_(keypath)

    elements = keypath.split('.')
    cur = obj
    elemiter = iter(elements)
    for e in elemiter:
        if e[:1] == '@':
            try:
                oper = getattr(_ArrayOperators, e[1:])
            except AttributeError:
                raise KeyError("Array operator %s not implemented" % (e,))
            return oper(cur, elemiter)
        cur = getKey(cur, e)
    return cur
def getKeyPath ( obj , keypath ) : if not keypath : raise KeyError if obj is None : return None if isinstance ( obj , ( objc . objc_object , objc . objc_class ) ) : return obj . valueForKeyPath_ ( keypath ) elements = keypath . split ( '.' ) cur = obj elemiter = iter ( elements ) for e in elemiter : if e [ : 1 ] == '@' : try : oper = getattr ( _ArrayOperators , e [ 1 : ] ) except AttributeError : raise KeyError ( "Array operator %s not implemented" % ( e , ) ) return oper ( cur , elemiter ) cur = getKey ( cur , e ) return cur