Changeset 921:11f9fb4fb178
- Timestamp:
- 04/27/19 12:06:32 (6 years ago)
- Branch:
- python3
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/fsuipc.py
r919 r921 13 13 import codecs 14 14 import math 15 from functools import total_ordering 15 16 16 17 if os.name == "nt" and "FORCE_PYUIPC_SIM" not in os.environ: … … 197 198 Handler._callSafe(lambda: self._callback(None, self._extra)) 198 199 200 @total_ordering 199 201 class PeriodicRequest(object): 200 202 """A periodic request.""" … … 250 252 pass 251 253 252 def __cmp__(self, other): 253 """Compare two periodic requests. They are ordered by their next 254 firing times.""" 255 return cmp(self._nextFire, other._nextFire) 254 def __eq__(self, other): 255 """Equality comparison by the firing times""" 256 return self._nextFire == other._nextFire 257 258 def __ne__(self, other): 259 """Non-equality comparison by the firing times""" 260 return self._nextFire != other._nextFire 261 262 def __lt__(self, other): 263 """Less-than comparison by the firing times""" 264 return self._nextFire < other._nextFire 256 265 257 266 def __init__(self, connectionListener, -
src/mlx/logger.py
r919 r921 7 7 import time 8 8 import bisect 9 from functools import total_ordering 9 10 10 11 #-------------------------------------------------------------------------------------- … … 34 35 increasing IDs.""" 35 36 37 @total_ordering 36 38 class Entry(object): 37 39 """An entry in the log.""" … … 119 121 id = self._id) 120 122 121 def __cmp__(self, other): 122 """Compare two entries 123 124 First their timestamps are compared, and if those are equal, then 125 their IDs.""" 126 result = cmp(self._timestamp, other.timestamp) 127 if result==0: 128 result = cmp(self._id, other._id) 129 return result 123 def __eq__(self, other): 124 """Equality comparison""" 125 return self._timestamp == other.timestamp and \ 126 self._id == other._id 127 128 def __ne__(self, other): 129 """Non-equality comparison""" 130 return self._timestamp != other.timestamp or \ 131 self._id != other._id 132 133 def __lt__(self, other): 134 """Less-than comparison""" 135 return self._timestamp < other.timestamp or \ 136 (self._timestamp == other.timestamp and 137 self._id < other._id) 130 138 131 139 class Fault(object): -
src/mlx/xplane.py
r919 r921 12 12 import codecs 13 13 import math 14 from functools import total_ordering 14 15 15 16 from xplra import XPlane, MultiGetter, MultiSetter, ProtocolException … … 148 149 return True 149 150 151 @total_ordering 150 152 class PeriodicRequest(object): 151 153 """A periodic request.""" … … 198 200 pass 199 201 200 def __cmp__(self, other): 201 """Compare two periodic requests. They are ordered by their next 202 firing times.""" 203 return cmp(self._nextFire, other._nextFire) 202 def __eq__(self, other): 203 """Equality comparison by the firing times""" 204 return self._nextFire == other._nextFire 205 206 def __ne__(self, other): 207 """Non-equality comparison by the firing times""" 208 return self._nextFire != other._nextFire 209 210 def __lt__(self, other): 211 """Less-than comparison by the firing times""" 212 return self._nextFire < other._nextFire 204 213 205 214 class PeriodicDataRequest(PeriodicRequest):
Note:
See TracChangeset
for help on using the changeset viewer.