[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>
changeset74b9f52ccf55
branchdefault
phasedraft
hiddenyes
parent revision#31327bd26931 [dataimport] Turn the module into a package
child revision#bab17bccca16 [connection] replace .running_dbapi_query with .hooks_in_progress
files modified by this revision
doc/3.21.rst
repoapi.py
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 74b9f52ccf55b36236809a0165d9db9546b064eb
# Parent 31327bd269318c13990649796fc62ccb7784d0fe
[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/repoapi.py b/repoapi.py
@@ -215,13 +215,10 @@
14 
15      system_sql = _srv_cnx_func('system_sql')
16 
17      # session data methods #####################################################
18 
19 -    get_shared_data = _srv_cnx_func('get_shared_data')
20 -    set_shared_data = _srv_cnx_func('set_shared_data')
21 -
22      @property
23      def transaction_data(self):
24          return self._cnx.transaction_data
25 
26      # meta-data accessors ######################################################
diff --git a/server/session.py b/server/session.py
@@ -549,32 +549,10 @@
27 
28      @property
29      def rql_rewriter(self):
30          return self._rewriter
31 
32 -    @_open_only
33 -    @deprecated('[3.19] use session or transaction data', stacklevel=3)
34 -    def get_shared_data(self, key, default=None, pop=False, txdata=False):
35 -        """return value associated to `key` in session data"""
36 -        if txdata:
37 -            data = self.transaction_data
38 -        else:
39 -            data = self._session_data
40 -        if pop:
41 -            return data.pop(key, default)
42 -        else:
43 -            return data.get(key, default)
44 -
45 -    @_open_only
46 -    @deprecated('[3.19] use session or transaction data', stacklevel=3)
47 -    def set_shared_data(self, key, value, txdata=False):
48 -        """set value associated to `key` in session data"""
49 -        if txdata:
50 -            self.transaction_data[key] = value
51 -        else:
52 -            self._session_data[key] = value
53 -
54      def clear(self):
55          """reset internal data"""
56          self.transaction_data = {}
57          #: ordered list of operations to be processed on commit/rollback
58          self.pending_operations = []
diff --git a/web/request.py b/web/request.py
@@ -1024,12 +1024,10 @@
59              self._ = self.__ = unicode
60              self.pgettext = lambda x, y: unicode(y)
61 
62      entity_metas = _cnx_func('entity_metas')
63      source_defs = _cnx_func('source_defs')
64 -    get_shared_data = _cnx_func('get_shared_data')
65 -    set_shared_data = _cnx_func('set_shared_data')
66      describe = _cnx_func('describe') # deprecated XXX
67 
68      # security #################################################################
69 
70      security_enabled = _cnx_func('security_enabled')