]> git.sesse.net Git - nms/commitdiff
Color coding!
authorSteinar H. Gunderson <sesse@samfundet.no>
Thu, 6 Apr 2006 13:20:22 +0000 (13:20 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Thu, 6 Apr 2006 13:20:22 +0000 (13:20 +0000)
zyxel/switchmap.py
zyxel/zyxelcommon.py

index c3c5432a3162b3eea98df14b91e92f8b1eb4e8a0..d15af7d9d78c7b864dea08d1291bba7a4dc844b5 100644 (file)
@@ -10,5 +10,5 @@ print ""
 for row in range(1,70,2):
        print "%2u: " % row,
        for sw in range(1,7):
-               print "%-15s " % retIP((row,sw)),
+               print retColor((row,sw)), "%-15s " % retIP((row,sw)),
        print ""
index 5609e5ceee84abfb52ff238a77a42fe3b4ad16e7..739be4447d42505425a43aa1b506a0cd16d57d2b 100644 (file)
@@ -22,3 +22,6 @@ def retIP(sw):
     lopenr = 2 + 6 * gangefaktor + num
     return NETWORK + ".%s.%s" % (retSubnet(sw), lopenr)
 
+# ooh, fugly
+def retColor(sw):
+    return "\e[%um" % (int(retSubnet(sw)) - 209)