summaryrefslogtreecommitdiff
path: root/sleekxmpp/api.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-06-19 01:29:48 -0700
committerLance Stout <lancestout@gmail.com>2012-06-19 01:29:48 -0700
commitd92aa05b5c18806ab5addc947eeedaaf4d51500e (patch)
treebdb64fa72894b6689b38fa6e96a29e15548422fd /sleekxmpp/api.py
parentf7a74d960edb3ced00423c081ec74e9e91f3aea2 (diff)
downloadslixmpp-d92aa05b5c18806ab5addc947eeedaaf4d51500e.tar.gz
slixmpp-d92aa05b5c18806ab5addc947eeedaaf4d51500e.tar.bz2
slixmpp-d92aa05b5c18806ab5addc947eeedaaf4d51500e.tar.xz
slixmpp-d92aa05b5c18806ab5addc947eeedaaf4d51500e.zip
PEP8 formatting updates.
Diffstat (limited to 'sleekxmpp/api.py')
-rw-r--r--sleekxmpp/api.py22
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.