Package com :: Module msgs
[hide private]
[frames] | no frames]

Module msgs

Application message types. These are dynamically populated by plugins.

Import this module to get access to all known message types:

 from com import Component, msgs
 
 class MyComponent(Component):
 
     def __init__(self):
     
         Component.__init__(self)
         
     
     def handle_message(self, msg, *args):
     
         if (msg == msgs.CORE_EV_APP_STARTED):
             self.call_service(msgs.NOTIFY_SVC_SHOW_MESSAGE,
                               "Application started")
Functions [hide private]
 
_id_to_name(ident)
Returns the name of the message given by the ID.
 
_register(name)
Registers a new message.
Variables [hide private]
  _cnt = 0
Function Details [hide private]

_id_to_name(ident)

 

Returns the name of the message given by the ID. This is an expensive operation and should only be used when logging error messages to the console. Even then, this function should only be used by the com subsystem internally.

Parameters:
  • ident - ID of the message, e.g. msgs.CORE_APPLICATION_SHUTDOWN
Returns:
printable name of the message, e.g. "CORE_APPLICATION_SHUTDOWN"

_register(name)

 

Registers a new message. This method is only used internally by com.Container.

Parameters:
  • name - name of message