summaryrefslogtreecommitdiff
path: root/gpscap.py
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-08-31 21:06:18 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-08-31 21:06:18 +0000
commit67dc3f7fa26d7d1c664eca372d53f89ea7394d8d (patch)
tree8a4cde5d15bef82f74aca0423e3567fd602e6571 /gpscap.py
parent3db1fa2d2caf268359a4486f600b6a460da95c6d (diff)
downloadgpsd-67dc3f7fa26d7d1c664eca372d53f89ea7394d8d.tar.gz
Add a hotplug icon to the capability chart.
Diffstat (limited to 'gpscap.py')
-rw-r--r--gpscap.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/gpscap.py b/gpscap.py
index c0e6c232..386d6094 100644
--- a/gpscap.py
+++ b/gpscap.py
@@ -1,6 +1,6 @@
"""
-gpscap - GPS capability dictionary class.
+gpscap - GPS/AIS capability dictionary class.
"""
import ConfigParser
@@ -67,6 +67,7 @@ class GPSDictionary(ConfigParser.RawConfigParser):
</tr>
"""
vhead = "<tr><td style='text-align:center;' colspan='7'><a href='%s'>%s</a></td></tr>\n"
+ hotpluggables = ("pl2303", "CP2101")
ofp.write(thead % (len(self.devices), len(self.vendors)))
for vendor in self.vendors:
ofp.write(vhead % (self.get(vendor, "vendor_site"), vendor))
@@ -114,15 +115,17 @@ class GPSDictionary(ConfigParser.RawConfigParser):
if self.has_option(dev, "noconfigure"):
testfield += "<img title='Requires -b option' src='noconfigure.png'>"
if self.get(dev, "status") == "excellent":
- testfield += "<img src='star.png'><img src='star.png'><img src='star.png'><img src='star.png'>"
+ testfield += "<img src='star.png'/><img src='star.png'/><img src='star.png'/><img src='star.png'/>"
elif self.get(dev, "status") == "good":
- testfield += "<img src='star.png'><img src='star.png'><img src='star.png'>"
+ testfield += "<img src='star.png'/><img src='star.png/'><img src='star.png'/>"
elif self.get(dev, "status") == "fair":
- testfield += "<img src='star.png'><img src='star.png'>"
+ testfield += "<img src='star.png'/><img src='star.png'/>"
elif self.get(dev, "status") == "poor":
- testfield += "<img src='star.png'>"
+ testfield += "<img src='star.png'/>"
elif self.get(dev, "status") == "broken":
- testfield += "<img title='Device is broken' src='bomb.png'>"
+ testfield += "<img title='Device is broken' src='bomb.png'/>"
+ if self.has_option(dev, "usbchip") and self.get(dev, "usbchip") in hotpluggables:
+ testfield += "<img src='hotplug.png'/>"
ofp.write("<td>%s</td>\n" % testfield)
nmea = "&nbsp;"
if self.has_option(dev, "nmea"):