예제 #1
0
class xmlrpc_connection(object):
    def __init__(self, host=None, port=8182):
        if host is None:
            host = gethostname()
        self.host = "%s:%s" % (host, port)
        self.transport = Transport()

    def remote(self, method, params=()):
        """ Invoke the server with the given method name and parameters.
            The return value is always a tuple. """
        return self.transport.request(self.host, "/RPC2", dumps(params, method))
예제 #2
0
class xmlrpc_connection(object):
    def __init__(self, host=None, port=8182):
        if host is None:
            host = gethostname()
        self.host = "%s:%s" % (host, port)
        self.transport = Transport()

    def remote(self, method, params=()):
        """ Invoke the server with the given method name and parameters.
            The return value is always a tuple. """
        return self.transport.request(self.host, '/RPC2',
                                      dumps(params, method))
예제 #3
0
class xmlrpc_connection:
    """The xmlrpc_connection class tests the xmlrpc_server.  You must 
    download and install the medusa and xmlrpclib libraries to run 
    this code:  http://www.nightmare.com  http://www.pythonware.com"""
    def __init__(self, host=None, port=2640):
        if host is None:
            host = gethostname()
        self.host = "%s:%s" % (host, port)
        self.transport = Transport()

    def remote(self, method, params=()):
        """remote invokes the server with the method name and an 
        optional set of parameters.  The return value is always a
        tuple."""

        response = self.transport.request(self.host, '/RPC2',
                                          dumps(params, method))
        return response
예제 #4
0
class xmlrpc_connection:
    """The xmlrpc_connection class tests the xmlrpc_server.  You must 
    download and install the medusa and xmlrpclib libraries to run 
    this code:  http://www.nightmare.com  http://www.pythonware.com"""

    def __init__(self, host=None, port=8182):
        if host is None:
            host = gethostname()
        self.host = "%s:%s" % (host, port)
        self.transport = Transport()

    def remote(self, method, params=()):
        """remote invokes the server with the method name and an 
        optional set of parameters.  The return value is always a
        tuple."""

        response = self.transport.request(self.host, 
                                          '/RPC2',
                                          dumps(params, method))
        return response
예제 #5
0
 def request(self, host, handler, request_body, verbose=0):
     """Make the request but using the with_timeout decorator."""
     return Transport.request(self, host, handler, request_body, verbose)
예제 #6
0
 def request(self, host, handler, request_body, verbose=0):
     """Make the request but using the with_timeout decorator."""
     return Transport.request(
         self, host, handler, request_body, verbose)
예제 #7
0
 def request(self, host, handler, request_body, verbose=0):
     self.__handler = handler
     return Transport.request(self, host, '/RPC2', request_body, verbose)
예제 #8
0
 def request(self, host, handler, request_body, verbose=0):
     self.__handler = handler
     return Transport.request(self, host, '/RPC2', request_body, verbose)
예제 #9
0
파일: proxy.py 프로젝트: GNOME/gnome-blog
 def request(self, host, handler, request_body, verbose=0):
     return Transport.request(self, host, "http://"+host+handler, request_body, verbose)