1.1 --- a/EventAggregatorSupport.py Wed May 04 00:56:24 2011 +0200
1.2 +++ b/EventAggregatorSupport.py Wed May 04 01:07:00 2011 +0200
1.3 @@ -109,6 +109,20 @@
1.4 else:
1.5 return cmp(x, y)
1.6
1.7 +def sort_start_first(x, y):
1.8 + x_ts = x.as_limits()
1.9 + if x_ts is not None:
1.10 + x_start, x_end = x_ts
1.11 + y_ts = y.as_limits()
1.12 + if y_ts is not None:
1.13 + y_start, y_end = y_ts
1.14 + start_order = cmp(x_start, y_start)
1.15 + if start_order == 0:
1.16 + return cmp(x_end, y_end)
1.17 + else:
1.18 + return start_order
1.19 + return 0
1.20 +
1.21 def sign(x):
1.22 if x < 0:
1.23 return -1