Package Products :: Package ZenWidgets :: Module messaging :: Class ScriptMessageSender |
[hide private]
[frames] | no frames]

# Class ScriptMessageSender

source code

       object --+
                |
    MessageSender --+
                    |
                   ScriptMessageSender

Special message sender for use in scripts. Short-circuits sendToBrowser and sendToUser, since they don't really apply. sendToAll should still work fine though.

Instance Methods | [hide private]
sendToBrowser(self, title, body, priority=INFO, image=None) Create a message and store it on the session object. | source code
sendToUser(self, title, body, priority=INFO, image=None, user=None) Create a message and store it in the IMessageQueue of the user specified. | source code
Inherited from `MessageSender`: `__init__`, `sendToAll`

Method Details | [hide private]

### sendToBrowser(self, title, body, priority=INFO, image=None) | source code
Create a message and store it on the session object. Parameters: `title` - The message title `body` - The body of the message `priority` - Message priority; one of INFO, WARNING, CRITICAL `image` - Optional URL of an image to be displayed in the message Overrides: MessageSender.sendToBrowser (inherited documentation)

### sendToUser(self, title, body, priority=INFO, image=None, user=None) | source code
Create a message and store it in the IMessageQueue of the user specified. If no user is specified, use the queue of the current user. Parameters: `title` - The message title `body` - The body of the message `priority` - Message priority; one of INFO, WARNING, CRITICAL `image` - Optional URL of an image to be displayed in the message `user` - Optional username corresponding to the queue to which messages should be sent. If left as `None`, the current user's queue will be used. Overrides: MessageSender.sendToUser (inherited documentation)