src/pyams_content/include.py
changeset 0 7c0001cacf8e
child 36 69a8e0ec5555
equal deleted inserted replaced
-1:000000000000 0:7c0001cacf8e
       
     1 #
       
     2 # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
       
     3 # All Rights Reserved.
       
     4 #
       
     5 # This software is subject to the provisions of the Zope Public License,
       
     6 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
       
     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
       
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
       
    10 # FOR A PARTICULAR PURPOSE.
       
    11 #
       
    12 
       
    13 __docformat__ = 'restructuredtext'
       
    14 
       
    15 
       
    16 # import standard library
       
    17 
       
    18 # import interfaces
       
    19 
       
    20 # import packages
       
    21 
       
    22 
       
    23 def include_package(config):
       
    24     """Pyramid include"""
       
    25 
       
    26     # add translations
       
    27     config.add_translation_dirs('pyams_content:locales')
       
    28 
       
    29     # load registry components
       
    30     try:
       
    31         import pyams_zmi
       
    32     except ImportError:
       
    33         config.scan(ignore='pyams_content.zmi')
       
    34     else:
       
    35         config.scan()
       
    36 
       
    37     if hasattr(config, 'load_zcml'):
       
    38         config.load_zcml('configure.zcml')