#NEWLINE# @ command ( port = int ) #NEWLINE# def do_run( self , port = 9090 ) : #NEWLINE# #INDENT# '\n        Usage: run [<port>]\n        ' #NEWLINE# reactor . listenTCP ( port , self . get_server ( ) , interface = '127.0.0.1' ) #NEWLINE# if ( self . manhole is True ) : #NEWLINE# #INDENT# from twisted.manhole.telnet import ShellFactory #NEWLINE# f = ShellFactory ( ) #NEWLINE# f . username = f . password = 'admin' #NEWLINE# reactor . listenTCP ( ( port + 1 ) , f ) #NEWLINE# #UNINDENT# msg ( 'Running reactor' ) #NEWLINE# self . batch = True #NEWLINE# if ( self . prefs [ 'gui' ] [ 'rememberme' ] is True ) : #NEWLINE# #INDENT# self . logincmd . username = self . prefs [ 'gui' ] [ 'username' ] #NEWLINE# self . logincmd . password = self . prefs [ 'gui' ] [ 'password' ] #NEWLINE# self . logincmd . email = self . prefs [ 'gui' ] [ 'email' ] #NEWLINE# #UNINDENT# ua = os . getenv ( 'LA_API_AGENT_INFO' ) #NEWLINE# if ( ua is not None ) : #NEWLINE# #INDENT# self . registry . session . prefs [ 'user_agent' ] += ( ( ' (' + ua ) + ')' ) #NEWLINE# #UNINDENT# reactor . run ( ) #NEWLINE# self . batch = False