# HG changeset patch # User Paul Boddie # Date 1431878409 -7200 # Node ID 74d2f393ad9d6579c4094a2c1f4ec654bd64dc2d # Parent a5e8c1027e599d1be6fdb098bfb9de59a00553e5 Removed special comparison callable for period sorting. diff -r a5e8c1027e59 -r 74d2f393ad9d imiptools/data.py --- a/imiptools/data.py Sun May 17 17:59:06 2015 +0200 +++ b/imiptools/data.py Sun May 17 18:00:09 2015 +0200 @@ -492,7 +492,7 @@ # Return a sorted list of the periods. - periods.sort(cmp=compare_periods(tzid)) + periods.sort() # Exclude exception dates. @@ -510,19 +510,6 @@ return periods -class compare_periods: - - "Compare periods for exception date purposes." - - def __init__(self, tzid): - self.tzid = tzid - - def __call__(self, first, second): - return cmp( - (to_datetime(first.get_start(), self.tzid), to_datetime(first.get_end(), self.tzid)), - (to_datetime(second.get_start(), self.tzid), to_datetime(second.get_end(), self.tzid)) - ) - def get_periods_for_freebusy(obj, periods, tzid): """