def makeTerm(node, title='Node', term='xterm', display=None, cmd='bash'):
 title = ('"%s: %s"' % (title, node.name))
 if (not node.inNamespace):
  title += ' (root)'
 cmds = {'xterm': ['xterm', '-title', title, '-display'], 'gterm': ['gnome-terminal', '--title', title, '--display']}
 if (term not in cmds):
  error(('invalid terminal type: %s' % term))
  return
 (display, tunnel) = tunnelX11(node, display)
 if (display is None):
  return []
 term = node.popen((cmds[term] + [display, '-e', ('env TERM=ansi %s' % cmd)]))
 return ([tunnel, term] if tunnel else [term])

def makeTerm ( node , title = 'Node' , term = 'xterm' , display = None , cmd = 'bash' ) : title = ( '"%s: %s"' % ( title , node . name ) ) if ( not node . inNamespace ) : title += ' (root)' cmds = { 'xterm' : [ 'xterm' , '-title' , title , '-display' ] , 'gterm' : [ 'gnome-terminal' , '--title' , title , '--display' ] } if ( term not in cmds ) : error ( ( 'invalid terminal type: %s' % term ) ) return ( display , tunnel ) = tunnelX11 ( node , display ) if ( display is None ) : return [ ] term = node . popen ( ( cmds [ term ] + [ display , '-e' , ( 'env TERM=ansi %s' % cmd ) ] ) ) return ( [ tunnel , term ] if tunnel else [ term ] )
create an x11 tunnel to the node and start up a terminal .