#NEWLINE# def start_listening( self ) : #NEWLINE# #INDENT# config = self . get_config ( ) #NEWLINE# for listener in config . listeners : #NEWLINE# #INDENT# if ( listener [ 'type' ] == 'http' ) : #NEWLINE# #INDENT# self . _listener_http ( config , listener ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( listener [ 'type' ] == 'manhole' ) : #NEWLINE# #INDENT# checker = checkers . InMemoryUsernamePasswordDatabaseDontUse ( matrix = 'rabbithole' ) #NEWLINE# rlm = manhole_ssh . TerminalRealm ( ) #NEWLINE# rlm . chainedProtocolFactory = ( lambda : insults . ServerProtocol ( ColoredManhole , { #NEWLINE# #INDENT# '__name__' : '__console__' , #NEWLINE# 'hs' : self , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# f = manhole_ssh . ConchFactory ( portal . Portal ( rlm , [ checker ] ) ) #NEWLINE# reactor . listenTCP ( listener [ 'port' ] , f , interface = listener . get ( 'bind_address' , '127.0.0.1' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . warn ( 'Unrecognized listener type: %s' , listener [ 'type' ] )