[web/request] clearly mark user_callback-related methods as deprecated
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 14 May 2014 15:05:31 +0200
changeset 10094 954765f57fb6
parent 10093 516a44ae2cc9
child 10095 200bd6a601dc
[web/request] clearly mark user_callback-related methods as deprecated The deprecated decorator not only emits a warning at run-time but above all makes the deprecation immediately apparent in the source. closes #3567793.
web/request.py
--- a/web/request.py	Wed Dec 03 15:24:47 2014 +0100
+++ b/web/request.py	Wed May 14 15:05:31 2014 +0200
@@ -403,6 +403,7 @@
             return breadcrumbs.pop()
         return self.base_url()
 
+    @deprecated('[3.19] use a traditional ajaxfunc / controller')
     def user_rql_callback(self, rqlargs, *args, **kwargs):
         """register a user callback to execute some rql query, and return a URL
         to call that callback which can be inserted in an HTML view.
@@ -438,6 +439,7 @@
         cbname = self.register_onetime_callback(cb, *cbargs)
         return "javascript: %s" % getattr(js, jsfunc)(cbname, *args)
 
+    @deprecated('[3.19] use a traditional ajaxfunc / controller')
     def register_onetime_callback(self, func, *args):
         cbname = build_cb_uid(func.__name__)
         def _cb(req):
@@ -448,12 +450,14 @@
         self.set_page_data(cbname, _cb)
         return cbname
 
+    @deprecated('[3.19] use a traditional ajaxfunc / controller')
     def unregister_callback(self, pageid, cbname):
         assert pageid is not None
         assert cbname.startswith('cb_')
         self.info('unregistering callback %s for pageid %s', cbname, pageid)
         self.del_page_data(cbname)
 
+    @deprecated('[3.19] use a traditional ajaxfunc / controller')
     def clear_user_callbacks(self):
         if self.session is not None: # XXX
             for key in list(self.session.data):