Changeset 923:fe2a902681bc for src/mlx
- Timestamp:
- 04/27/19 12:11:14 (6 years ago)
- Branch:
- python3
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/timetable.py
r919 r923 752 752 planes = [plane for plane in fleet 753 753 if plane.aircraftType == aircraftType] 754 planes.sort( cmp = lambda p1, p2: cmp(p1.tailNumber, p2.tailNumber))754 planes.sort(key = lambda p: p.tailNumber) 755 755 756 756 dialog = BookDialog(self, flightPair, planes) -
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) -
src/mlx/web.py
r919 r923 791 791 result.flights.append(flight) 792 792 793 result.flights.sort(cmp = lambda flight1, flight2: 794 cmp(flight1.departureTime, 795 flight2.departureTime)) 793 result.flights.sort(key = lambda flight: flight.departureTime) 796 794 797 795 f.close()
Note:
See TracChangeset
for help on using the changeset viewer.