[shared data] remove get/set_shared_data api

It was redundant with session_data and transaction_data and costly to maintain.

Closes #3938370.

authorAurelien Campeas <aurelien.campeas@logilab.fr>
changeset7e9f31ae0130
branchdefault
phasedraft
hiddenyes
parent revision#480187dd66b3 [web] move AbstractAuthManager near its immediate concrete subclass
child revision<not specified>
files modified by this revision
doc/3.21.rst
server/session.py
web/request.py
# HG changeset patch
# User Aurelien Campeas <aurelien.campeas@logilab.fr>
# Date 1401813425 -7200
# Tue Jun 03 18:37:05 2014 +0200
# Node ID 7e9f31ae0130c4fb1b0ba44c558a77bbd3423b9b
# Parent 480187dd66b3c5b0eebe922e9cba8d4f3a34efaa
[shared data] remove get/set_shared_data api

It was redundant with session_data and transaction_data
and costly to maintain.

Closes #3938370.

diff --git a/doc/3.21.rst b/doc/3.21.rst
@@ -27,10 +27,13 @@
1  ---------------------
2 
3  * the user_callback api has been removed; people should use plain
4    ajax functions instead
5 
6 +* the get/set_shared_data api has been removed; people should use
7 +  transaction_data or session_data instead
8 +
9  * the `Pyro` and `Zmq-pickle` remote repository access methods have
10    been entirely removed (emerging alternatives such as rqlcontroller
11    and cwclientlib should be used instead).  Note that as a side effect,
12    "repository-only" instances (i.e. without a http component) are no
13    longer possible.  If you have any such instances, you will need to
diff --git a/server/session.py b/server/session.py
@@ -419,32 +419,10 @@
14 
15      @property
16      def rql_rewriter(self):
17          return self._rewriter
18 
19 -    @_open_only
20 -    @deprecated('[3.19] use session or transaction data', stacklevel=3)
21 -    def get_shared_data(self, key, default=None, pop=False, txdata=False):
22 -        """return value associated to `key` in session data"""
23 -        if txdata:
24 -            data = self.transaction_data
25 -        else:
26 -            data = self._session_data
27 -        if pop:
28 -            return data.pop(key, default)
29 -        else:
30 -            return data.get(key, default)
31 -
32 -    @_open_only
33 -    @deprecated('[3.19] use session or transaction data', stacklevel=3)
34 -    def set_shared_data(self, key, value, txdata=False):
35 -        """set value associated to `key` in session data"""
36 -        if txdata:
37 -            self.transaction_data[key] = value
38 -        else:
39 -            self._session_data[key] = value
40 -
41      def clear(self):
42          """reset internal data"""
43          self.transaction_data = {}
44          #: ordered list of operations to be processed on commit/rollback
45          self.pending_operations = []
diff --git a/web/request.py b/web/request.py
@@ -1026,12 +1026,10 @@
46              self._ = self.__ = unicode
47              self.pgettext = lambda x, y: unicode(y)
48 
49      entity_metas = _cnx_func('entity_metas')
50      source_defs = _cnx_func('source_defs')
51 -    get_shared_data = _cnx_func('get_shared_data')
52 -    set_shared_data = _cnx_func('set_shared_data')
53      describe = _cnx_func('describe') # deprecated XXX
54 
55      # security #################################################################
56 
57      security_enabled = _cnx_func('security_enabled')