- class slidge.util.ABCSubclassableOnceAtMost(name, bases, dct)#
Metaclass for defining Abstract Base Classes (ABCs).
Use this metaclass to create an ABC. An ABC can be subclassed directly, and then acts as a mix-in class. You can also register unrelated concrete classes (even built-in classes) and unrelated ABCs as ‘virtual subclasses’ – these and their descendants will be considered subclasses of the registering ABC by the built-in issubclass() function, but the registering ABC won’t show up in their MRO (Method Resolution Order) nor will method implementations defined by the registering ABC be callable (not even via super()).
- class slidge.util.BiDict(*args, **kwargs)#
Abstract base class for generic types.
A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:
class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc.
This class can then be used as follows:
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default
Initialize self. See help(type(self)) for accurate signature.
- __setitem__(key, value)#
Set self[key] to value.
key (KeyType) –
value (ValueType) –
- class slidge.util.FormField#
Represents a field of the form that a user will see when registering to the gateway via their XMPP client.
- var :str =#
Internal name of the field, will be used to retrieve via
- label :Optional[str]#
Description of the field that the aspiring user will see
- required :bool = False#
Whether this field is mandatory or not
- private :bool = False#
For sensitive info that should not be displayed on screen while the user types. Forces field_type to “text-private”
- value :str =#
Pre-filled value. Will be automatically pre-filled if a registered user modifies their subscription
- options :Optional[list[dict[str, str]]]#
- class slidge.util.SubclassableOnce(name, bases, dct)#
- TEST_MODE = False#