Fix syntax and spelling mistkaes
This commit is contained in:
parent
e6250adfea
commit
507efbc654
2 changed files with 9 additions and 9 deletions
|
|
@ -139,7 +139,7 @@ class Connection():
|
|||
Add a function to be called when a packet of type ptype is received.
|
||||
"""
|
||||
|
||||
self.callbacks.add_callback(ptype, callback, *args, **kwargs)
|
||||
self.callbacks.add(ptype, callback, *args, **kwargs)
|
||||
|
||||
def add_id_callback(self, pid, callback, *args, **kwargs):
|
||||
"""
|
||||
|
|
@ -148,7 +148,7 @@ class Connection():
|
|||
Add a function to be called when a packet with id pid is received.
|
||||
"""
|
||||
|
||||
self.id_callbacks.add_callback(pid, callback, *args, **kwargs)
|
||||
self.id_callbacks.add(pid, callback, *args, **kwargs)
|
||||
|
||||
def call_callback(self, event, *args):
|
||||
"""
|
||||
|
|
@ -157,7 +157,7 @@ class Connection():
|
|||
Call all callbacks subscribed to the event with *args.
|
||||
"""
|
||||
|
||||
self.callbacks.call_callback(event, *args)
|
||||
self.callbacks.call(event, *args)
|
||||
|
||||
def call_id_callback(self, pid, *args):
|
||||
"""
|
||||
|
|
@ -166,8 +166,8 @@ class Connection():
|
|||
Call all callbacks subscribed to the pid with *args.
|
||||
"""
|
||||
|
||||
self.id_callbacks.call_callback(pid, *args)
|
||||
self.id_callbacks.del_callbacks(pid)
|
||||
self.id_callbacks.call(pid, *args)
|
||||
self.id_callbacks.remove(pid)
|
||||
|
||||
def handle_json(self, data):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@ class Message():
|
|||
"""
|
||||
|
||||
self.id = id
|
||||
self time = time
|
||||
self.time = time
|
||||
self.sender = sender
|
||||
self.content = content
|
||||
self.parent = parent
|
||||
self edited = edited
|
||||
self.edited = edited
|
||||
self.deleted = deleted
|
||||
self.truncated = truncated
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ class Message():
|
|||
Has this message been deleted?
|
||||
"""
|
||||
|
||||
return True self.deleted is not None else False
|
||||
return True if self.deleted is not None else False
|
||||
|
||||
def is_truncated(self):
|
||||
"""
|
||||
|
|
@ -96,4 +96,4 @@ class Message():
|
|||
Has this message been truncated?
|
||||
"""
|
||||
|
||||
return True self.truncated is not None else False
|
||||
return True if self.truncated is not None else False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue