Mercurial > libervia-backend
comparison sat_frontends/bridge/pb.py @ 3163:d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 10 Feb 2020 22:01:53 +0100 |
parents | 559a625a236b |
children | 439e2f88c3a9 |
comparison
equal
deleted
inserted
replaced
3162:b5c058c7692e | 3163:d10b2368684e |
---|---|
485 d.addCallback(lambda __: callback()) | 485 d.addCallback(lambda __: callback()) |
486 if errback is None: | 486 if errback is None: |
487 errback = self._generic_errback | 487 errback = self._generic_errback |
488 d.addErrback(errback) | 488 d.addErrback(errback) |
489 | 489 |
490 def privateDataDelete(self, namespace, key, arg_2, callback=None, errback=None): | |
491 d = self.root.callRemote("privateDataDelete", namespace, key, arg_2) | |
492 if callback is not None: | |
493 d.addCallback(lambda __: callback()) | |
494 if errback is None: | |
495 errback = self._generic_errback | |
496 d.addErrback(errback) | |
497 | |
498 def privateDataGet(self, namespace, key, profile_key, callback=None, errback=None): | |
499 d = self.root.callRemote("privateDataGet", namespace, key, profile_key) | |
500 if callback is not None: | |
501 d.addCallback(callback) | |
502 if errback is None: | |
503 errback = self._generic_errback | |
504 d.addErrback(errback) | |
505 | |
506 def privateDataSet(self, namespace, key, data, profile_key, callback=None, errback=None): | |
507 d = self.root.callRemote("privateDataSet", namespace, key, data, profile_key) | |
508 if callback is not None: | |
509 d.addCallback(lambda __: callback()) | |
510 if errback is None: | |
511 errback = self._generic_errback | |
512 d.addErrback(errback) | |
513 | |
490 def profileCreate(self, profile, password='', component='', callback=None, errback=None): | 514 def profileCreate(self, profile, password='', component='', callback=None, errback=None): |
491 d = self.root.callRemote("profileCreate", profile, password, component) | 515 d = self.root.callRemote("profileCreate", profile, password, component) |
492 if callback is not None: | 516 if callback is not None: |
493 d.addCallback(lambda __: callback()) | 517 d.addCallback(lambda __: callback()) |
494 if errback is None: | 518 if errback is None: |
857 def paramsRegisterApp(self, xml, security_limit=-1, app=''): | 881 def paramsRegisterApp(self, xml, security_limit=-1, app=''): |
858 d = self.root.callRemote("paramsRegisterApp", xml, security_limit, app) | 882 d = self.root.callRemote("paramsRegisterApp", xml, security_limit, app) |
859 d.addErrback(self._errback) | 883 d.addErrback(self._errback) |
860 return d.asFuture(asyncio.get_event_loop()) | 884 return d.asFuture(asyncio.get_event_loop()) |
861 | 885 |
886 def privateDataDelete(self, namespace, key, arg_2): | |
887 d = self.root.callRemote("privateDataDelete", namespace, key, arg_2) | |
888 d.addErrback(self._errback) | |
889 return d.asFuture(asyncio.get_event_loop()) | |
890 | |
891 def privateDataGet(self, namespace, key, profile_key): | |
892 d = self.root.callRemote("privateDataGet", namespace, key, profile_key) | |
893 d.addErrback(self._errback) | |
894 return d.asFuture(asyncio.get_event_loop()) | |
895 | |
896 def privateDataSet(self, namespace, key, data, profile_key): | |
897 d = self.root.callRemote("privateDataSet", namespace, key, data, profile_key) | |
898 d.addErrback(self._errback) | |
899 return d.asFuture(asyncio.get_event_loop()) | |
900 | |
862 def profileCreate(self, profile, password='', component=''): | 901 def profileCreate(self, profile, password='', component=''): |
863 d = self.root.callRemote("profileCreate", profile, password, component) | 902 d = self.root.callRemote("profileCreate", profile, password, component) |
864 d.addErrback(self._errback) | 903 d.addErrback(self._errback) |
865 return d.asFuture(asyncio.get_event_loop()) | 904 return d.asFuture(asyncio.get_event_loop()) |
866 | 905 |