summaryrefslogtreecommitdiff
path: root/gps
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-03-10 14:55:09 -0500
committerEric S. Raymond <esr@thyrsus.com>2011-03-10 14:55:09 -0500
commit947c427e3691fb4bd2c49585e7478198c9481219 (patch)
treed9d46314d1c090e0415ff48b441f5054acab2b10 /gps
parent736379fc0411971e4f2aa3e8d048ab1205dbcc76 (diff)
downloadgpsd-947c427e3691fb4bd2c49585e7478198c9481219.tar.gz
Library time parsing is now backward-compatible with 2.95.
Diffstat (limited to 'gps')
-rwxr-xr-xgps/gps.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gps/gps.py b/gps/gps.py
index 372293c9..d305a346 100755
--- a/gps/gps.py
+++ b/gps/gps.py
@@ -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)