#NEWLINE# def lookupProcedure( self , procedurePath ) : #NEWLINE# #INDENT# "\n        Given a string naming a procedure, return a callable object for that\n        procedure or raise NoSuchFunction.\n\n        The returned object will be called, and should return the result of the\n        procedure, a Deferred, or a Fault instance.\n\n        Override in subclasses if you want your own policy.  The base\n        implementation that given C{'foo'}, C{self.xmlrpc_foo} will be returned.\n        If C{procedurePath} contains C{self.separator}, the sub-handler for the\n        initial prefix is used to search for the remaining path.\n\n        If you override C{lookupProcedure}, you may also want to override\n        C{listProcedures} to accurately report the procedures supported by your\n        resource, so that clients using the I{system.listMethods} procedure\n        receive accurate results.\n\n        @since: 11.1\n        " #NEWLINE# if ( procedurePath . find ( self . separator ) != ( - 1 ) ) : #NEWLINE# #INDENT# ( prefix , procedurePath ) = procedurePath . split ( self . separator , 1 ) #NEWLINE# handler = self . getSubHandler ( prefix ) #NEWLINE# if ( handler is None ) : #NEWLINE# #INDENT# raise NoSuchFunction ( self . NOT_FOUND , ( 'no such subHandler %s' % prefix ) ) #NEWLINE# #UNINDENT# return handler . lookupProcedure ( procedurePath ) #NEWLINE# #UNINDENT# f = getattr ( self , ( 'xmlrpc_%s' % procedurePath ) , None ) #NEWLINE# if ( not f ) : #NEWLINE# #INDENT# raise NoSuchFunction ( self . NOT_FOUND , ( 'procedure %s not found' % procedurePath ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not callable ( f ) ) : #NEWLINE# #INDENT# raise NoSuchFunction ( self . NOT_FOUND , ( 'procedure %s not callable' % procedurePath ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return f