x = px else: x += px if y is None: y = py else: y += py # if we found values, set some guides if len(average.keys()) > 0: ax = float(x) / len(average.keys()) ay = float(y) / len(average.keys()) # first, guides for the average # attention: a vertical guide has a horizontal value g.appendVGuide(ax) # attention: a horizontal guide has a vertical value g.appendHGuide(ay) # then some guides for the off-curves if len(guides.keys()) > 0: for gx, gy in guides.keys(): g.appendVGuide(gx) g.appendHGuide(gy) g.update() else: print "no points selected" g.update()