#NEWLINE# def dispatch( self , args ) : #NEWLINE# #INDENT# opts = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# command = self . commands [ args . command ] #NEWLINE# for option in command . options : #NEWLINE# #INDENT# name = option [ 1 ] #NEWLINE# if ( name in args ) : #NEWLINE# #INDENT# opts [ name ] = getattr ( args , name ) #NEWLINE# #UNINDENT# #UNINDENT# if args . help : #NEWLINE# #INDENT# print ( textwrap . dedent ( option . __doc__ ) ) #NEWLINE# return 0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if hasattr ( args , 'start' ) : #NEWLINE# #INDENT# opts [ 'start' ] = args . start #NEWLINE# #UNINDENT# if ( ( args . endpoint is None ) and ( command . msg_type != 'dealer' ) ) : #NEWLINE# #INDENT# if ( command . msg_type == 'sub' ) : #NEWLINE# #INDENT# args . endpoint = DEFAULT_ENDPOINT_SUB #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# args . endpoint = DEFAULT_ENDPOINT_DEALER #NEWLINE# #UNINDENT# #UNINDENT# msg = command . message ( * args . args , ** opts ) #NEWLINE# handler = getattr ( self , ( 'handle_%s' % command . msg_type ) ) #NEWLINE# return handler ( command , self . globalopts , msg , args . endpoint , int ( args . timeout ) , args . ssh , args . ssh_keyfile )