From 5eae1352c7c1377dc5be679a9699663a399668fb Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 20 Jan 2009 22:23:58 +0000 Subject: GPSes in the hardware table now feature Michelin rating... ...and the occasional bomb :-) --- gpscap.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'gpscap.py') diff --git a/gpscap.py b/gpscap.py index ade51afb..e3de8d6b 100644 --- a/gpscap.py +++ b/gpscap.py @@ -76,9 +76,7 @@ class GPSDictionary(ConfigParser.RawConfigParser): relevant.sort() for dev in relevant: rowcolor = "#FFFFFF" - if self.has_option(dev, "broken"): - rowcolor = "Pink" - elif self.get(dev, "packaging") == "OEM module": + if self.get(dev, "packaging") == "OEM module": rowcolor = "LimeGreen" elif self.get(dev, "packaging") == "chipset": rowcolor = "LightYellow" @@ -88,7 +86,10 @@ class GPSDictionary(ConfigParser.RawConfigParser): rowcolor = "DarkCyan" ofp.write("\n" % rowcolor) - ofp.write("%s\n" % dev) + namefield = dev + if self.has_option(dev, "discontinued"): + namefield = dev + " " + ofp.write("%s\n" % namefield) ofp.write("%s\n" % self.get(dev, "packaging")) engine = self.get(dev, "engine") if self.has_option(engine, "reference"): @@ -100,14 +101,24 @@ class GPSDictionary(ConfigParser.RawConfigParser): if self.has_option(dev, "pps"): interfaces += ",PPS" ofp.write("%s\n" % interfaces) - tested = "" - if self.get(dev, "status") == "broken": - tested = "Broken" - elif self.get(dev, "tested") == "regression": - tested = "*" - else: + testfield = "" + if self.has_option(dev, "tested"): tested = self.get(dev, "tested") - ofp.write("%s\n" % tested) + if tested == "regression": + testfield += "" + else: + testfield += tested + if self.get(dev, "status") == "excellent": + testfield += "" + elif self.get(dev, "status") == "good": + testfield += "" + elif self.get(dev, "status") == "fair": + testfield += "" + elif self.get(dev, "status") == "poor": + testfield += "" + elif self.get(dev, "status") == "broken": + testfield += "" + ofp.write("%s\n" % testfield) nmea = " " if self.has_option(dev, "nmea"): nmea = self.get(dev, "nmea") -- cgit v1.2.1