Changeset 923:fe2a902681bc for src/mlx/rpc.py
- Timestamp:
- 04/27/19 12:11:14 (5 years ago)
- Branch:
- python3
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/rpc.py
r919 r923 111 111 cs1 = int(self.callsign[2:]) 112 112 cs2 = int(other.callsign[2:]) 113 return cmp(cs1, cs2)113 return 0 if cs1==cs2 else -1 if cs1<cs2 else 1 114 114 except: 115 return cmp(self.callsign, other.callsign) 115 return 0 if self.callsign==other.callsign \ 116 else -1 if self.callsign<other.callsign else 1 116 117 else: 117 return cmp(getattr(self, name), getattr(other, name)) 118 v1 = getattr(self, name) 119 v2 = getattr(other, name) 120 return 0 if v1==v2 else -1 if v1<v2 else 1 118 121 119 122 def __repr__(self): … … 166 169 flightPairs.append(ScheduledFlightPair(flight)) 167 170 168 flightPairs.sort(cmp = lambda pair1, pair2: 169 cmp(pair1.flight0.date, pair2.flight0.date)) 171 flightPairs.sort(key = lambda pair: pair.flight0.date) 170 172 171 173 return flightPairs … … 523 525 524 526 for flights in [bookedFlights, reportedFlights, rejectedFlights]: 525 flights.sort(cmp = lambda flight1, flight2: 526 cmp(flight1.departureTime, flight2.departureTime)) 527 flights.sort(key = lambda flight: flight.departureTime) 527 528 528 529 return (bookedFlights, reportedFlights, rejectedFlights)
Note:
See TracChangeset
for help on using the changeset viewer.