'Given a string naming a procedure, return a callable object for that
procedure or raise NoSuchFunction.
The returned object will be called, and should return the result of the
procedure, a Deferred, or a Fault instance.
Override in subclasses if you want your own policy.  The base
implementation that given C{\'foo\'}, C{self.xmlrpc_foo} will be returned.
If C{procedurePath} contains C{self.separator}, the sub-handler for the
initial prefix is used to search for the remaining path.
If you override C{lookupProcedure}, you may also want to override
C{listProcedures} to accurately report the procedures supported by your
resource, so that clients using the I{system.listMethods} procedure
receive accurate results.
@since: 11.1'

def lookupProcedure(self, procedurePath):

    if (procedurePath.find(self.separator) != (-1)):
        (prefix, procedurePath) = procedurePath.split(self.separator, 1)
        handler = self.getSubHandler(prefix)
        if (handler is None):
            raise NoSuchFunction(self.NOT_FOUND, ('no    such    subHandler    %s' % prefix))
        return handler.lookupProcedure(procedurePath)
    f = getattr(self, ('xmlrpc_%s' % procedurePath), None)
    if (not f):
        raise NoSuchFunction(self.NOT_FOUND, ('procedure    %s    not    found' % procedurePath))
    elif (not callable(f)):
        raise NoSuchFunction(self.NOT_FOUND, ('procedure    %s    not    callable' % procedurePath))
    else:
        return f
