diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-03-10 14:55:09 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-03-10 14:55:09 -0500 |
commit | 947c427e3691fb4bd2c49585e7478198c9481219 (patch) | |
tree | d9d46314d1c090e0415ff48b441f5054acab2b10 /gps | |
parent | 736379fc0411971e4f2aa3e8d048ab1205dbcc76 (diff) | |
download | gpsd-947c427e3691fb4bd2c49585e7478198c9481219.tar.gz |
Library time parsing is now backward-compatible with 2.95.
Diffstat (limited to 'gps')
-rwxr-xr-x | gps/gps.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -262,7 +262,11 @@ class gps(gpsdata, gpsjson): self.valid = ONLINE_SET self.utc = default("time", None, TIME_SET) if self.utc is not None: - self.fix.time = isotime(self.utc.encode("ascii")) + # Time can be either Unix time as a float or an ISO8601 string + if type(self.fix.time) == type(0.0): + self.fix.time = self.utc + else: + self.fix.time = isotime(self.utc.encode("ascii")) self.fix.ept = default("ept", NaN, TIMERR_SET) self.fix.latitude = default("lat", NaN, LATLON_SET) self.fix.longitude = default("lon", NaN) |