src/pyams_utils/context.py
changeset 97 02671458ec76
parent 72 9049384a2bd4
child 150 09f49ce8dfd8
equal deleted inserted replaced
96:a543685e0ca1 97:02671458ec76
    24     """Interface based context selector
    24     """Interface based context selector
    25 
    25 
    26     This selector can be used as a subscriber predicate to define
    26     This selector can be used as a subscriber predicate to define
    27     an interface that the context must support for the event to be applied::
    27     an interface that the context must support for the event to be applied::
    28 
    28 
       
    29     .. code-block:: python
       
    30 
    29         from pyams_utils.interfaces.site import ISiteRoot
    31         from pyams_utils.interfaces.site import ISiteRoot
    30 
    32 
    31         @subscriber(IObjectModifiedEvent, context_selector=ISiteRoot)
    33         @subscriber(IObjectModifiedEvent, context_selector=ISiteRoot)
    32         def siteroot_modified_event_handler(event):
    34         def siteroot_modified_event_handler(event):
    33             '''This is an event handler for an ISiteRoot object modification event'''
    35             '''This is an event handler for an ISiteRoot object modification event'''