diff options
| author | Vo Minh Thu <vmt@openerp.com> | 2012-01-16 12:06:31 +0100 |
|---|---|---|
| committer | Vo Minh Thu <vmt@openerp.com> | 2012-01-16 12:06:31 +0100 |
| commit | 3203d264aecd751a8c261cea4f72fa323a3098be (patch) | |
| tree | 93cdf7c89795b809963ef08a68d84d293cf41a7a /addons/web/common | |
| parent | 1497062ba1dbfd814c69fa4250c4eb6a09a5206a (diff) | |
| parent | 064a50bcde5f1c65a17f4feb42348b5809081085 (diff) | |
[MERGE] merged trunk.
bzr revid: vmt@openerp.com-20120116110631-lrzp6uxsjki7by22
Diffstat (limited to 'addons/web/common')
| -rw-r--r-- | addons/web/common/http.py | 4 | ||||
| -rw-r--r-- | addons/web/common/openerplib/main.py | 18 | ||||
| -rw-r--r-- | addons/web/common/release.py | 2 | ||||
| -rw-r--r-- | addons/web/common/session.py | 1 |
4 files changed, 9 insertions, 16 deletions
diff --git a/addons/web/common/http.py b/addons/web/common/http.py index f3ac8d0bcd9..17ccfb63d8a 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -10,6 +10,7 @@ import os import pprint import sys import threading +import time import traceback import urllib import uuid @@ -331,8 +332,9 @@ def session_context(request, storage_path, session_cookie='sessionid'): if (isinstance(value, session.OpenERPSession) and not value._uid and not value.jsonp_requests + and value._creation_time + (60*5) < time.time() # FIXME do not use a fixed value ): - _logger.info('remove session %s: %r', key, value.jsonp_requests) + _logger.debug('remove session %s', key) del request.session[key] with session_lock: diff --git a/addons/web/common/openerplib/main.py b/addons/web/common/openerplib/main.py index 2cbf9692063..93c2d1da69d 100644 --- a/addons/web/common/openerplib/main.py +++ b/addons/web/common/openerplib/main.py @@ -50,15 +50,6 @@ class Connector(object): __logger = _getChildLogger(_logger, 'connector') - def __init__(self, hostname, port): - """ - Initilize by specifying an hostname and a port. - :param hostname: Host name of the server. - :param port: Port for the connection to the server. - """ - self.hostname = hostname - self.port = port - def get_service(self, service_name): """ Returns a Service instance to allow easy manipulation of one of the services offered by the remote server. @@ -81,8 +72,7 @@ class XmlRPCConnector(Connector): :param hostname: The hostname of the computer holding the instance of OpenERP. :param port: The port used by the OpenERP instance for XMLRPC (default to 8069). """ - Connector.__init__(self, hostname, port) - self.url = 'http://%s:%d/xmlrpc' % (self.hostname, self.port) + self.url = 'http://%s:%d/xmlrpc' % (hostname, port) def send(self, service_name, method, *args): url = '%s/%s' % (self.url, service_name) @@ -97,9 +87,9 @@ class XmlRPCSConnector(XmlRPCConnector): __logger = _getChildLogger(_logger, 'connector.xmlrpcs') - def __init__(self, hostname, port=8071): + def __init__(self, hostname, port=8069): super(XmlRPCSConnector, self).__init__(hostname, port) - self.url = 'https://%s:%d/xmlrpc' % (self.hostname, self.port) + self.url = 'https://%s:%d/xmlrpc' % (hostname, port) class Service(object): """ @@ -294,7 +284,7 @@ def get_connector(hostname=None, protocol="xmlrpc", port="auto"): :param port: The number of the port. Defaults to auto. """ if port == 'auto': - port = 8069 if protocol=="xmlrpc" else 8071 + port = 8069 if protocol == "xmlrpc": return XmlRPCConnector(hostname, port) elif protocol == "xmlrpcs": diff --git a/addons/web/common/release.py b/addons/web/common/release.py index 47570c032bb..fdc30ee33d7 100644 --- a/addons/web/common/release.py +++ b/addons/web/common/release.py @@ -1,5 +1,5 @@ name = 'openerp-web' -version = '6.1.0 alpha' +version = '6.1rc1' description = "Web Client of OpenERP, the Enterprise Management Software" long_description = "OpenERP Web is the web client of the OpenERP, a free enterprise management software" author = "OpenERP SA" diff --git a/addons/web/common/session.py b/addons/web/common/session.py index ac0489b2ff3..ca23a08da4a 100644 --- a/addons/web/common/session.py +++ b/addons/web/common/session.py @@ -29,6 +29,7 @@ class OpenERPSession(object): round-tripped to the client browser. """ def __init__(self): + self._creation_time = time.time() self.config = None self._db = False self._uid = False |
