src/pyams_utils/include.py
changeset 195 65b6d930b42b
parent 152 98ded173ec22
child 216 8a6c250fe655
equal deleted inserted replaced
194:9313b3c435eb 195:65b6d930b42b
    20 from zope.annotation.interfaces import IAttributeAnnotatable, IAnnotations
    20 from zope.annotation.interfaces import IAttributeAnnotatable, IAnnotations
    21 from zope.keyreference.interfaces import IKeyReference
    21 from zope.keyreference.interfaces import IKeyReference
    22 
    22 
    23 # import packages
    23 # import packages
    24 from chameleon import PageTemplateFile
    24 from chameleon import PageTemplateFile
       
    25 from pyams_utils.container import ParentSelector
    25 from pyams_utils.context import ContextSelector
    26 from pyams_utils.context import ContextSelector
    26 from pyams_utils.request import get_annotations, get_debug, RequestSelector
    27 from pyams_utils.request import get_annotations, get_debug, RequestSelector
    27 from pyams_utils.site import site_factory
    28 from pyams_utils.site import site_factory
    28 from pyams_utils.tales import ExtensionExpr
    29 from pyams_utils.tales import ExtensionExpr
    29 from pyams_utils.traversing import NamespaceTraverser
    30 from pyams_utils.traversing import NamespaceTraverser
    48     # add traverser handling namespaces via "++ns++(options)" URLs
    49     # add traverser handling namespaces via "++ns++(options)" URLs
    49     config.add_traverser(NamespaceTraverser)
    50     config.add_traverser(NamespaceTraverser)
    50 
    51 
    51     # add custom subscriber predicate to filter events via supported interface(s)
    52     # add custom subscriber predicate to filter events via supported interface(s)
    52     config.add_subscriber_predicate('context_selector', ContextSelector)
    53     config.add_subscriber_predicate('context_selector', ContextSelector)
       
    54     config.add_subscriber_predicate('parent_selector', ParentSelector)
    53     config.add_subscriber_predicate('request_selector', RequestSelector)
    55     config.add_subscriber_predicate('request_selector', RequestSelector)
    54 
    56 
    55     # load registry components
    57     # load registry components
    56     config.registry.registerAdapter(AttributeAnnotations, (IAttributeAnnotatable, ), IAnnotations)
    58     config.registry.registerAdapter(AttributeAnnotations, (IAttributeAnnotatable, ), IAnnotations)
    57     config.registry.registerAdapter(KeyReferenceToPersistent, (IPersistent, ), IKeyReference)
    59     config.registry.registerAdapter(KeyReferenceToPersistent, (IPersistent, ), IKeyReference)