server/session.py
changeset 9774 b7b71be569cf
parent 9764 e81facdef9b5
child 9934 e32964e28a45
equal deleted inserted replaced
9773:71a45642b3d2 9774:b7b71be569cf
   547     @property
   547     @property
   548     def rql_rewriter(self):
   548     def rql_rewriter(self):
   549         return self._rewriter
   549         return self._rewriter
   550 
   550 
   551     @_open_only
   551     @_open_only
       
   552     @deprecated('[3.19] use session or transaction data')
   552     def get_shared_data(self, key, default=None, pop=False, txdata=False):
   553     def get_shared_data(self, key, default=None, pop=False, txdata=False):
   553         """return value associated to `key` in session data"""
   554         """return value associated to `key` in session data"""
   554         if txdata:
   555         if txdata:
   555             data = self.transaction_data
   556             data = self.transaction_data
   556         else:
   557         else:
   559             return data.pop(key, default)
   560             return data.pop(key, default)
   560         else:
   561         else:
   561             return data.get(key, default)
   562             return data.get(key, default)
   562 
   563 
   563     @_open_only
   564     @_open_only
       
   565     @deprecated('[3.19] use session or transaction data')
   564     def set_shared_data(self, key, value, txdata=False):
   566     def set_shared_data(self, key, value, txdata=False):
   565         """set value associated to `key` in session data"""
   567         """set value associated to `key` in session data"""
   566         if txdata:
   568         if txdata:
   567             self.transaction_data[key] = value
   569             self.transaction_data[key] = value
   568         else:
   570         else:
  1556         assert value == {}
  1558         assert value == {}
  1557         pass
  1559         pass
  1558 
  1560 
  1559     # shared data handling ###################################################
  1561     # shared data handling ###################################################
  1560 
  1562 
       
  1563     @deprecated('[3.19] use session or transaction data')
  1561     def get_shared_data(self, key, default=None, pop=False, txdata=False):
  1564     def get_shared_data(self, key, default=None, pop=False, txdata=False):
  1562         """return value associated to `key` in session data"""
  1565         """return value associated to `key` in session data"""
  1563         if txdata:
  1566         if txdata:
  1564             return self._cnx.get_shared_data(key, default, pop, txdata=True)
  1567             return self._cnx.get_shared_data(key, default, pop, txdata=True)
  1565         else:
  1568         else:
  1567         if pop:
  1570         if pop:
  1568             return data.pop(key, default)
  1571             return data.pop(key, default)
  1569         else:
  1572         else:
  1570             return data.get(key, default)
  1573             return data.get(key, default)
  1571 
  1574 
       
  1575     @deprecated('[3.19] use session or transaction data')
  1572     def set_shared_data(self, key, value, txdata=False):
  1576     def set_shared_data(self, key, value, txdata=False):
  1573         """set value associated to `key` in session data"""
  1577         """set value associated to `key` in session data"""
  1574         if txdata:
  1578         if txdata:
  1575             return self._cnx.set_shared_data(key, value, txdata=True)
  1579             return self._cnx.set_shared_data(key, value, txdata=True)
  1576         else:
  1580         else: