summaryrefslogtreecommitdiff
path: root/poezio/core/structs.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2017-11-12 15:03:09 +0100
committermathieui <mathieui@mathieui.net>2017-11-12 15:03:09 +0100
commitd55cc5872503567775f0d7a7731d6f489bf2299b (patch)
tree725f9e7b8144d36054447b3c82edfb45bda8df1d /poezio/core/structs.py
parent92496db823db34f7f7fb1ab31eaef093a707c3e8 (diff)
downloadpoezio-d55cc5872503567775f0d7a7731d6f489bf2299b.tar.gz
poezio-d55cc5872503567775f0d7a7731d6f489bf2299b.tar.bz2
poezio-d55cc5872503567775f0d7a7731d6f489bf2299b.tar.xz
poezio-d55cc5872503567775f0d7a7731d6f489bf2299b.zip
yapf -ir
Diffstat (limited to 'poezio/core/structs.py')
-rw-r--r--poezio/core/structs.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/poezio/core/structs.py b/poezio/core/structs.py
index 7d568f04..72c9628a 100644
--- a/poezio/core/structs.py
+++ b/poezio/core/structs.py
@@ -2,8 +2,10 @@
Module defining structures useful to the core class and related methods
"""
-__all__ = ['ERROR_AND_STATUS_CODES', 'DEPRECATED_ERRORS', 'POSSIBLE_SHOW',
- 'Status', 'Command', 'Completion']
+__all__ = [
+ 'ERROR_AND_STATUS_CODES', 'DEPRECATED_ERRORS', 'POSSIBLE_SHOW', 'Status',
+ 'Command', 'Completion'
+]
# http://xmpp.org/extensions/xep-0045.html#errorstatus
ERROR_AND_STATUS_CODES = {
@@ -15,7 +17,7 @@ ERROR_AND_STATUS_CODES = {
'407': 'You are not in the member list',
'409': 'This nickname is already in use or has been reserved',
'503': 'The maximum number of users has been reached',
- }
+}
# http://xmpp.org/extensions/xep-0086.html
DEPRECATED_ERRORS = {
@@ -48,14 +50,18 @@ POSSIBLE_SHOW = {
'xa': 'xa'
}
+
class Status:
__slots__ = ('show', 'message')
+
def __init__(self, show, message):
self.show = show
self.message = message
+
class Command:
__slots__ = ('func', 'desc', 'comp', 'short_desc', 'usage')
+
def __init__(self, func, desc, comp, short_desc, usage):
self.func = func
self.desc = desc
@@ -63,11 +69,13 @@ class Command:
self.short_desc = short_desc
self.usage = usage
+
class Completion:
"""
A completion result essentially currying the input completion call.
"""
__slots__ = ['func', 'args', 'kwargs', 'comp_list']
+
def __init__(self, func, comp_list, *args, **kwargs):
self.func = func
self.comp_list = comp_list