Genetare html for host kernel
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 4 Dec 2010 15:56:43 +0000 (16:56 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 4 Dec 2010 15:56:43 +0000 (16:56 +0100)
gw-tests/genhtml/genhtml.py

index 4c16a95..70e918f 100755 (executable)
@@ -37,7 +37,7 @@ class Dimension(dict):
 
 class DimensionKern(Dimension):
     def __init__(self):
-       Dimension.__init__(self, 'kern', 'Kernel')
+       Dimension.__init__(self, 'gwkern', 'GW kernel')
     def htmlLabel(self, v):
        i=v.find(":")
        if i>0: kver=v[:i]
@@ -50,6 +50,24 @@ class DimensionKern(Dimension):
            else: kver=v
            yield kver
 
+class DimensionHostKern(Dimension):
+    def __init__(self):
+       Dimension.__init__(self, 'hostkern', 'Host kernel')
+    def htmlLabel(self, v):
+        if v.find("host-") == 0:
+            v = v[5:]
+        # TODO: remove host- prefix
+       i = v.find(":")
+       if i>0: kver = v[:i]
+        else: kver = v
+       return v+"<br><a href='config-%s'>config</a>"%(urllib.quote(kver))
+    def versions(self):
+       for v in self.values:
+           i=v.find(":")
+           if i>0: kver=v[:i]
+           else: kver=v
+           yield kver
+
 class DimensionTest(Dimension):
     def __init__(self):
        Dimension.__init__(self, 'test', 'Test')
@@ -202,6 +220,6 @@ th, td { border: 1px solid lightgray; padding: 4px;}
 
 if __name__ == "__main__":
     os.chdir(sys.argv[1])
-    tests = Tests("./", DimensionKern(), DimensionTraffic(), DimensionTest())
+    tests = Tests("./", DimensionHostKern(), DimensionKern(), DimensionTraffic(), DimensionTest())
     tests.generateHtml()
     sys.exit(0)