def InstallManagementConsole(namespace, users={'admin': 'admin'}, port=503):
 from twisted.internet import reactor
 def build_protocol():
  p = insults.ServerProtocol(manhole.ColoredManhole, namespace)
  return p
 r = manhole_ssh.TerminalRealm()
 r.chainedProtocolFactory = build_protocol
 c = checkers.InMemoryUsernamePasswordDatabaseDontUse(**users)
 p = portal.Portal(r, [c])
 factory = manhole_ssh.ConchFactory(p)
 reactor.listenTCP(port, factory)

def InstallManagementConsole ( namespace , users = { 'admin' : 'admin' } , port = 503 ) : from twisted . internet import reactor def build_protocol ( ) : p = insults . ServerProtocol ( manhole . ColoredManhole , namespace ) return p r = manhole_ssh . TerminalRealm ( ) r . chainedProtocolFactory = build_protocol c = checkers . InMemoryUsernamePasswordDatabaseDontUse ( ** users ) p = portal . Portal ( r , [ c ] ) factory = manhole_ssh . ConchFactory ( p ) reactor . listenTCP ( port , factory )
helper method to start an ssh management console for the modbus server .