Package trac :: Package notification :: Module api :: Class INotificationSubscriber

Class INotificationSubscriber

source code

    object --+    
             |    
core.Interface --+
                 |
                INotificationSubscriber

Subscribe to notification events.
Instance Methods
 
matches(event)
Return a list of subscriptions that match the given event.
source code
 
description()
Description of the subscription shown in the preferences UI.
source code
 
requires_authentication()
Can only authenticated users subscribe?
source code
 
default_subscriptions()
Optionally return a list of default subscriptions.
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

matches(event)

source code 
Return a list of subscriptions that match the given event.
Parameters:
Returns:
a list of tuples (class, distributor, sid, authenticated, address, format, priority, adverb), where small priority values override larger ones and adverb is either 'always' or 'never'.

default_subscriptions()

source code 

Optionally return a list of default subscriptions.

Default subscriptions that the module will automatically generate. This should only be used in reasonable situations, where users can be determined by the event itself. For instance, ticket author has a default subscription that is controlled via trac.ini. This is because we can lookup the ticket author during the event and create a subscription for them. Default subscriptions should be low priority so that the user can easily override them.

Returns:
a list of tuples (class, distributor, format, priority, adverb)