diff options
author | Beat Bolli <bbolli@ewanet.ch> | 2011-01-05 10:09:18 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-01-05 10:09:18 -0500 |
commit | a5cc7dcadf3093876372c940d6f2a7e71a7fc847 (patch) | |
tree | f570b1e7e9af0e68b0dfc990527ba4d169f8aa8b /gps | |
parent | 7b1aa762fdc06199b19ea3871c3ccb6c6158c5d1 (diff) | |
download | gpsd-a5cc7dcadf3093876372c940d6f2a7e71a7fc847.tar.gz |
Various small fixes to Python client mode.
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Diffstat (limited to 'gps')
-rwxr-xr-x | gps/gps.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -16,7 +16,7 @@ # import time from client import * -import misc +from misc import isotime NaN = float('nan') def isnan(x): return str(x) == 'nan' @@ -267,6 +267,8 @@ class gps(gpsdata, gpsjson): elif self.data.get("class") == "TPV": self.valid = ONLINE_SET self.fix.time = default("time", NaN, TIME_SET) + if not isnan(self.fix.time): + self.utc = isotime(self.fix.time) self.fix.ept = default("ept", NaN, TIMERR_SET) self.fix.latitude = default("lat", NaN, LATLON_SET) self.fix.longitude = default("lon", NaN) @@ -316,7 +318,7 @@ class gps(gpsdata, gpsjson): return 0 def next(self): - if self.poll() == -1: + if self.read() == -1: raise StopIteration if hasattr(self, "data"): return self.data @@ -329,7 +331,7 @@ class gps(gpsdata, gpsjson): # If we're looking at a daemon that speaks JSON, this # should have been set when we saw the initial VERSION # response. Note, however, that this requires at - # least one poll() before stream() is called + # least one read() before stream() is called if self.newstyle or flags & WATCH_NEWSTYLE: flags |= WATCH_JSON else: |