Bug in coil and output element sorting function fixed
authorlbessard
Wed, 01 Oct 2008 17:49:02 +0200
changeset 280 9ca192486f2f
parent 279 2ad276084038
child 281 eb49f3f511cc
Bug in coil and output element sorting function fixed
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