Author: sleon
Date: 2006-01-06 23:56:02 +0000 (Fri, 06 Jan 2006)
New Revision: 7778

Modified:
   trunk/apps/freeviz/gen.py
Log:
added version info to viz

Modified: trunk/apps/freeviz/gen.py
===================================================================
--- trunk/apps/freeviz/gen.py   2006-01-06 23:38:39 UTC (rev 7777)
+++ trunk/apps/freeviz/gen.py   2006-01-06 23:56:02 UTC (rev 7778)
@@ -3,12 +3,13 @@
 import sys,os
 import pydot
 import sys
+import re

 sys.path+=['/home/sleon/public_html/bla/']
 from db import *

 def gentopology():
-
+       regver = re.compile('.*,(\d+)')
        #NodePair.createTable( ifNotExists=True )
        node_pairs = list(NodePair.select())
        nodes = list(Node.select())
@@ -16,13 +17,20 @@


        for node in nodes:
+               matc = regver.match(node.version)
+               if matc:
+                       nversion = matc.group(1)
+               else:
+                       nversion = '0'
+
                gnode = pydot.Node(node.name,  label='''\
 <<FONT POINT-SIZE="10px"><table CELLBORDER="0" border="0"
   CELLPADDING="0"
   CELLSPACING="3"
 ><tr><td align="left">%s</td>
 </tr><tr><td align="left">%s</td></tr>
-</table></FONT>>''' % (node.name,node.location[0:7]) )
+<tr><td>Ver. %s</td></tr>
+</table></FONT>>''' % (node.name,node.location[0:7],nversion ))
                g.add_node(gnode)

        #there are no dublicate edges in the database 


Reply via email to