diff options
author | Lance Stout <lancestout@gmail.com> | 2012-06-19 21:50:33 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2012-06-19 21:50:33 -0700 |
commit | 5820d49cd401a1362a8a675c4b91935adb1240fe (patch) | |
tree | f40f78839ae3004bfb0b8da1ae93d61759d8ad66 /sleekxmpp/api.py | |
parent | 1ab66e576786ecb0cfb9b6b163811735564b951b (diff) | |
parent | 36c11ad9de7c1b5a199aa5a4302e33085513c126 (diff) | |
download | slixmpp-5820d49cd401a1362a8a675c4b91935adb1240fe.tar.gz slixmpp-5820d49cd401a1362a8a675c4b91935adb1240fe.tar.bz2 slixmpp-5820d49cd401a1362a8a675c4b91935adb1240fe.tar.xz slixmpp-5820d49cd401a1362a8a675c4b91935adb1240fe.zip |
Merge branch 'master' into develop
Conflicts:
sleekxmpp/basexmpp.py
Diffstat (limited to 'sleekxmpp/api.py')
-rw-r--r-- | sleekxmpp/api.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sleekxmpp/api.py b/sleekxmpp/api.py index 3261f67f..103de2ff 100644 --- a/sleekxmpp/api.py +++ b/sleekxmpp/api.py @@ -16,24 +16,24 @@ class APIWrapper(object): elif attr == 'settings': return self.api.settings[self.name] elif attr == 'register': - def curried_handler(handler, op, jid=None, node=None, default=False): + def partial(handler, op, jid=None, node=None, default=False): register = getattr(self.api, attr) return register(handler, self.name, op, jid, node, default) - return curried_handler + return partial elif attr == 'register_default': - def curried_handler(handler, op, jid=None, node=None): + def partial(handler, op, jid=None, node=None): return getattr(self.api, attr)(handler, self.name, op) - return curried_handler + return partial elif attr in ('run', 'restore_default', 'unregister'): - def curried_handler(*args, **kwargs): + def partial(*args, **kwargs): return getattr(self.api, attr)(self.name, *args, **kwargs) - return curried_handler + return partial return None def __getitem__(self, attr): - def curried_handler(jid=None, node=None, ifrom=None, args=None): + def partial(jid=None, node=None, ifrom=None, args=None): return self.api.run(self.name, attr, jid, node, ifrom, args) - return curried_handler + return partial class APIRegistry(object): @@ -42,7 +42,7 @@ class APIRegistry(object): self._handlers = {} self._handler_defaults = {} self.xmpp = xmpp - self.settings = {} + self.settings = {} def _setup(self, ctype, op): """Initialize the API callback dictionaries. @@ -138,8 +138,8 @@ class APIRegistry(object): """Register an API callback, with JID+node specificity. The API callback can later be executed based on the - specificity of the provided JID+node combination. - + specificity of the provided JID+node combination. + See :meth:`~ApiRegistry.run` for more details. :param string ctype: The name of the API to use. |