Changeset 12486 in genesis for tools


Ignore:
Timestamp:
Oct 19, 2013, 10:09:17 AM (11 years ago)
Author:
rick
Message:

Allow link specific features

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/make-network-graph.py

    r12479 r12486  
    22# vim:ts=2:et:sw=2:ai
    33#
     4#
    45# Build topological network graph
     6#
    57# Rick van der Zwet <info@rickvanderzwet.nl>
     8#
    69import gformat
    710import glob
     
    1417
    1518OUTFILE = os.path.join(os.getcwd(),'network.png')
     19LINK_SPECIFIC = False
    1620
    1721try:
     
    3539  try:
    3640    for host in gformat.get_hostlist():
     41      # Filter should be proper argument
    3742      if not pass_filter(host):
    3843        continue
     
    128133    for index,lid in enumerate(leden[:-1]):
    129134      for buur in leden[index + 1:]:
    130         print >> f,'  %s -> %s [color="%s", weight="%s", style="setlinewidth(%s)"]' % (lid, buur, color, weight, width)
     135        if LINK_SPECIFIC:
     136          print >> f,'  %s -> %s [color="%s", weight="%s", style="setlinewidth(%s)"]' % (lid, buur, color, weight, width)
     137        else:
     138          print >> f,'  %s -> %s [color="%s", weight="%s", style="setlinewidth(%s)"]' % (lid.split(':')[0], buur.split(':')[0], color, weight, width)
    131139  print >> f, "}"
    132140  f.flush()
Note: See TracChangeset for help on using the changeset viewer.