#NEWLINE# def run( self ) : #NEWLINE# #INDENT# self . sock = socket . socket ( socket . AF_INET , socket . SOCK_STREAM ) #NEWLINE# self . sock . setsockopt ( socket . SOL_SOCKET , socket . SO_REUSEADDR , 1 ) #NEWLINE# try : #NEWLINE# #INDENT# self . sock . bind ( ( 'localhost' , self . port ) ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# self . sock . listen ( 5 ) #NEWLINE# while True : #NEWLINE# #INDENT# ( s , address ) = self . sock . accept ( ) #NEWLINE# print ( ( 'Conection from %s' % str ( address ) ) ) #NEWLINE# realio = ( sys . stdout , sys . stdin , sys . stderr ) #NEWLINE# socketio = RtDebugger ( s , realio ) #NEWLINE# ( sys . stdout , sys . stdin , sys . stderr ) = ( socketio , socketio , socketio ) #NEWLINE# try : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# code . interact ( banner = self . banner , local = { #NEWLINE# #INDENT# 'list' : servers , #NEWLINE# 'servers' : servers , #NEWLINE# 'get_server' : get_server , #NEWLINE# 'get' : get_server , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# ( sys . stdout , sys . stdin , sys . stderr ) = realio #NEWLINE# #UNINDENT# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# print ( e ) #NEWLINE# #UNINDENT# except SystemExit as e : #NEWLINE# #INDENT# print ( e ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# s . close ( ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass