src/pyams_utils/include.py
branchdev-tf
changeset 427 63284c98cdc1
parent 408 cf2304af0fab
equal deleted inserted replaced
426:2022e4da3ad9 427:63284c98cdc1
     7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
     7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
    10 # FOR A PARTICULAR PURPOSE.
    10 # FOR A PARTICULAR PURPOSE.
    11 #
    11 #
       
    12 
       
    13 """PyAMS_utils.include module
       
    14 
       
    15 This module is used for Pyramid integration
       
    16 """
    12 
    17 
    13 from chameleon import PageTemplateFile
    18 from chameleon import PageTemplateFile
    14 from persistent.interfaces import IPersistent
    19 from persistent.interfaces import IPersistent
    15 from z3c.pt.pagetemplate import PageTemplateFile as Z3cPageTemplateFile
    20 from z3c.pt.pagetemplate import PageTemplateFile as Z3cPageTemplateFile
    16 from zope.annotation.attribute import AttributeAnnotations
    21 from zope.annotation.attribute import AttributeAnnotations
    58     # load registry components
    63     # load registry components
    59     config.registry.registerAdapter(AttributeAnnotations, (IAttributeAnnotatable, ), IAnnotations)
    64     config.registry.registerAdapter(AttributeAnnotations, (IAttributeAnnotatable, ), IAnnotations)
    60     config.registry.registerAdapter(KeyReferenceToPersistent, (IPersistent, ), IKeyReference)
    65     config.registry.registerAdapter(KeyReferenceToPersistent, (IPersistent, ), IKeyReference)
    61 
    66 
    62     try:
    67     try:
    63         import pyams_zmi
    68         import pyams_zmi  # pylint: disable=import-outside-toplevel,unused-import
    64     except ImportError:
    69     except ImportError:
    65         config.scan(ignore='pyams_utils.zmi')
    70         config.scan(ignore='pyams_utils.zmi')
    66     else:
    71     else:
    67         config.scan()
    72         config.scan()
    68 
    73