Package trac :: Package notification :: Module api :: Class INotificationFormatter

Class INotificationFormatter

source code

    object --+    
             |    
core.Interface --+
                 |
                INotificationFormatter

Convert events into messages appropriate for a given transport.
Instance Methods
 
get_supported_styles(transport)
Return a list of supported styles.
source code
 
format(transport, style, event)
Convert the event to an appropriate message.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

get_supported_styles(transport)

source code 
Return a list of supported styles.
Parameters:
  • transport - the name of a transport
Returns:
a list of tuples (style, realm)

format(transport, style, event)

source code 
Convert the event to an appropriate message.
Parameters:
  • transport - the name of a transport
  • style - the name of a supported style
Returns:
The return type of this method depends on transport and must be compatible with the INotificationDistributor that handles messages for this transport.