def dumpNodeConnections(nodes):
 def dumpConnections(node):
  'Helper function: dump connections to node'
  for intf in node.intfList():
   output((' %s:' % intf))
   if intf.link:
    intfs = [intf.link.intf1, intf.link.intf2]
    intfs.remove(intf)
    output(intfs[0])
   else:
    output(' ')
 for node in nodes:
  output(node.name)
  dumpConnections(node)
  output('\n')

def dumpNodeConnections ( nodes ) : def dumpConnections ( node ) : for intf in node . intfList ( ) : output ( ( ' %s:' % intf ) ) if intf . link : intfs = [ intf . link . intf1 , intf . link . intf2 ] intfs . remove ( intf ) output ( intfs [ 0 ] ) else : output ( ' ' ) for node in nodes : output ( node . name ) dumpConnections ( node ) output ( '\n' )
dump connections to/from nodes .