'perform two point gesture.
Usage:
d().gesture(startPoint1, startPoint2).to(endPoint1, endPoint2, steps)
d().gesture(startPoint1, startPoint2, endPoint1, endPoint2, steps)'

def gesture(self, start1, start2, *args, **kwargs):

    def to(obj_self, end1, end2, steps=100):
        ctp = (lambda pt: (point(*pt) if (type(pt) == tuple) else pt))
        (s1, s2, e1, e2) = (ctp(start1), ctp(start2), ctp(end1), ctp(end2))
        return self.jsonrpc.gesture(self.selector, s1, s2, e1, e2, steps)
    obj = type('Gesture', (object,), {'to': to})()
    return (obj if (len(args) == 0) else to(None, *args, **kwargs))
