Registering messages

 
 
 

A new message must be registered with the theMessageRegistry singleton in the MessageRegistry module before it can be created or queued for processing. You must first import the theMessageRegistry class as follows:

from MessageRegistry import theMessageRegistry

The following code demontrates how to register a method.

theMessageRegistry.register("CONVERT_LABELS", (str, tuple, tuple), Message.kUndoable, CONVERT_LABELS_Doc)

All registered messages must have a unique message ID, which is usually a name. The message ID must not contain spaces.

NoteThe message registry is thread-safe.