class kxg.tokens.TokenExtension(actor, token)[source]

Bases: kxg.forums.ForumObserver

Public Methods:

__init__(actor, token)

Initialize self.



Inherited from ForumObserver

namedtuple(field_names, *[, rename, …])

Returns a new subclass of tuple with named fields.

__init__(actor, token)

Initialize self.



subscribe_to_message(message_cls, callback)

subscribe_to_sync_response(message_cls, callback)

subscribe_to_undo_response(message_cls, callback)

unsubscribe_from_message(message_cls[, callback])



Private Methods:

Inherited from ForumObserver







_add_callback(event, message_cls, callback)

_drop_callback(event, message_cls, callback)

_call_callbacks(event, message)


class CallbackInfo(message_cls, callback)

Bases: tuple

__add__(value, /)

Return self+value.

__contains__(key, /)

Return key in self.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__getitem__(key, /)

Return self[key].


Return self as a plain tuple. Used by copy and pickle.

__gt__(value, /)

Return self>value.


Return hash(self).


Implement iter(self).

__le__(value, /)

Return self<=value.


Return len(self).

__lt__(value, /)

Return self<value.

__mul__(value, /)

Return self*value.

__ne__(value, /)

Return self!=value.

static __new__(_cls, message_cls, callback)

Create new instance of CallbackInfo(message_cls, callback)


Return a nicely formatted representation string

__rmul__(value, /)

Return value*self.

__slots__ = ()

Return a new OrderedDict which maps field names to their values.

_fields = ('message_cls', 'callback')
_fields_defaults = {}
classmethod _make(iterable)

Make a new CallbackInfo object from a sequence or iterable


Return a new CallbackInfo object replacing specified fields with new values

property callback

Alias for field number 1

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

property message_cls

Alias for field number 0

__init__(actor, token)[source]

Initialize self. See help(type(self)) for accurate signature.

_add_callback(event, message_cls, callback)
_call_callbacks(event, message)
_drop_callback(event, message_cls, callback)
namedtuple(field_names, *, rename=False, defaults=None, module=None)

Returns a new subclass of tuple with named fields.

>>> Point = namedtuple('Point', ['x', 'y'])
>>> Point.__doc__                   # docstring for the new class
'Point(x, y)'
>>> p = Point(11, y=22)             # instantiate with positional args or keywords
>>> p[0] + p[1]                     # indexable like a plain tuple
>>> x, y = p                        # unpack like a regular tuple
>>> x, y
(11, 22)
>>> p.x + p.y                       # fields also accessible by name
>>> d = p._asdict()                 # convert to a dictionary
>>> d['x']
>>> Point(**d)                      # convert from a dictionary
Point(x=11, y=22)
>>> p._replace(x=100)               # _replace() is like str.replace() but targets named fields
Point(x=100, y=22)
subscribe_to_message(message_cls, callback)
subscribe_to_sync_response(message_cls, callback)
subscribe_to_undo_response(message_cls, callback)
unsubscribe_from_message(message_cls, callback=None)
unsubscribe_from_sync_response(message_cls, callback=None)
unsubscribe_from_undo_response(message_cls, callback=None)