messages.hooks module

Provides user message hooking functionality.

class messages.hooks.HookUserMessageBase(user_message)[source]

Bases: core.AutoUnload

Base decorator for user message hooks.

__init__(user_message)[source]

Create a new user message hook.

Parameters:

user_message (int/str) – The user message index or name to hook.

Raises:
  • TypeError – Raised if user_message is not and int or str.
  • ValueError – Raised if the user message does not exist.
hooks

Return all hooks for a user message.

Return type:ListenerManager
class messages.hooks.HookBitBufferUserMessage(user_message)[source]

Bases: messages.hooks.HookUserMessageBase

Decorator to register a raw user message hook for bitbuffer messages.

hooks = defaultdict(<class '_listeners.ListenerManager'>, {})
class messages.hooks.HookProtobufUserMessage(user_message)[source]

Bases: messages.hooks.HookUserMessageBase

Decorator to register a raw user message hook for protobuf messages.

hooks = defaultdict(<class '_listeners.ListenerManager'>, {})
class messages.hooks.HookUserMessage(user_message)[source]

Bases: messages.hooks.HookUserMessageBase

Decorator to register a convenient user message hook.

__init__(user_message)[source]

Create a new user message hook.

Raises:NotImplementedError – Raised if the user message has not been implemented yet in Source.Python.
hooks = defaultdict(<class '_listeners.ListenerManager'>, {})