(allocation, direction)
return(edge, p1, p2)
Return the edge of the supplied allocation that we will care about for
    directional navigation
Return the edge of the supplied allocation that we will care about for
    directional navigation
Return the edge of the supplied allocation that we will care about for directional navigation
def get_edge(allocation, direction):
    """Return the edge of the supplied allocation that we will care about for
    directional navigation"""
    if direction == 'left':
        edge = allocation.x
        p1, p2 = allocation.y, allocation.y + allocation.height
    elif direction == 'up':
        edge = allocation.y
        p1, p2 = allocation.x, allocation.x + allocation.width
    elif direction == 'right':
        edge = allocation.x + allocation.width
        p1, p2 = allocation.y, allocation.y + allocation.height
    elif direction == 'down':
        edge = allocation.y + allocation.height
        p1, p2 = allocation.x, allocation.x + allocation.width
    else:
        raise ValueError('unknown direction %s' % direction)
    
    return(edge, p1, p2)
def get_edge ( allocation , direction ) : if direction == 'left' : edge = allocation . x p1 , p2 = allocation . y , allocation . y + allocation . height elif direction == 'up' : edge = allocation . y p1 , p2 = allocation . x , allocation . x + allocation . width elif direction == 'right' : edge = allocation . x + allocation . width p1 , p2 = allocation . y , allocation . y + allocation . height elif direction == 'down' : edge = allocation . y + allocation . height p1 , p2 = allocation . x , allocation . x + allocation . width else : raise ValueError ( 'unknown direction %s' % direction ) return ( edge , p1 , p2 )