# HG changeset patch # User lbessard # Date 1222876142 -7200 # Node ID 9ca192486f2f87b00e5f2840dc16bb80d700fbe3 # Parent 2ad2760840388d230b9801476e24b97f49b58f5f Bug in coil and output element sorting function fixed diff -r 2ad276084038 -r 9ca192486f2f PLCGenerator.py --- a/PLCGenerator.py Thu Sep 25 10:29:47 2008 +0200 +++ b/PLCGenerator.py Wed Oct 01 17:49:02 2008 +0200 @@ -64,10 +64,10 @@ def SortInstances(a, b): ax, ay = int(a.getx()), int(a.gety()) bx, by = int(b.getx()), int(b.gety()) - if abs(ax - ay) < 10: - return ax.__cmp__(bx) + if abs(ay - by) < 10: + return cmp(ax, bx) else: - return ay.__cmp__(by) + return cmp(ay, by) #------------------------------------------------------------------------------- # Specific exception for PLC generating errors