diff --git a/openerpweb/openerpweb.py b/openerpweb/openerpweb.py index 835d43ef358..19d6ec1eeb4 100644 --- a/openerpweb/openerpweb.py +++ b/openerpweb/openerpweb.py @@ -16,7 +16,6 @@ import cherrypy.lib.static import simplejson import nonliterals -import xmlrpctimeout import logging #----------------------------------------------------------- @@ -93,8 +92,6 @@ class OpenERPSession(object): self.client_timezone = False def proxy(self, service): - # TODO: correct this bug with timeout connections not working in python 2.7 - # s = xmlrpctimeout.TimeoutServerProxy('http://%s:%s/xmlrpc/%s' % (self._server, self._port, service), timeout=5) s = xmlrpclib.ServerProxy('http://%s:%s/xmlrpc/%s' % (self._server, self._port, service)) return s diff --git a/openerpweb/xmlrpctimeout.py b/openerpweb/xmlrpctimeout.py deleted file mode 100644 index 28f9bcd41bd..00000000000 --- a/openerpweb/xmlrpctimeout.py +++ /dev/null @@ -1,30 +0,0 @@ -import xmlrpclib -import httplib - -class TimeoutHTTPConnection(httplib.HTTPConnection): - def connect(self): - httplib.HTTPConnection.connect(self) - self.sock.settimeout(self.timeout) - -class TimeoutHTTP(httplib.HTTP): - _connection_class = TimeoutHTTPConnection - def set_timeout(self, timeout): - self._conn.timeout = timeout - -class TimeoutTransport(xmlrpclib.Transport): - def __init__(self, timeout=10, *l, **kw): - xmlrpclib.Transport.__init__(self,*l,**kw) - self.timeout=timeout - def make_connection(self, host): - conn = TimeoutHTTP(host) - conn.set_timeout(self.timeout) - return conn - -class TimeoutServerProxy(xmlrpclib.ServerProxy): - def __init__(self,uri,timeout=10,*l,**kw): - kw['transport']=TimeoutTransport(timeout=timeout, use_datetime=kw.get('use_datetime',0)) - xmlrpclib.ServerProxy.__init__(self,uri,*l,**kw) - -if __name__ == "__main__": - s=TimeoutServerProxy('http://127.0.0.1:9090',timeout=2) - s.dummy()