summaryrefslogtreecommitdiff
path: root/gps.py
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-09-22 23:08:34 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-09-22 23:08:34 +0000
commit0b87f38c11d786a3ebeddeac536ea3e62ad31998 (patch)
treefad99f7b95079c18356bafc36304ad3dcea8d5d7 /gps.py
parenta39a89c7d6fa9eeab2eef21f6e8da028177e7168 (diff)
downloadgpsd-0b87f38c11d786a3ebeddeac536ea3e62ad31998.tar.gz
Oops - cope well if there is no satellite data.
Diffstat (limited to 'gps.py')
-rwxr-xr-xgps.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gps.py b/gps.py
index 20a2d739..fb5f9945 100755
--- a/gps.py
+++ b/gps.py
@@ -484,8 +484,9 @@ class gps(gpsdata):
self.skyview.gpsdata = self
for attrp in "xyvhpg":
setattr(self.skyview, attrp+"dop", default(attrp+"dop", NaN, DOP_SET))
- for sat in self.data['satellites']:
- self.skyview.satellites.append(satellite(PRN=sat['PRN'], elevation=sat['el'], azimuth=sat['az'], ss=sat['ss'], used=sat['used']))
+ if "satellites" in self.data:
+ for sat in self.data['satellites']:
+ self.skyview.satellites.append(satellite(PRN=sat['PRN'], elevation=sat['el'], azimuth=sat['az'], ss=sat['ss'], used=sat['used']))
self.skyview.used = 0
for sat in self.skyview.satellites:
if sat.used: