src/pyams_form/include.py
changeset 0 7a0b409fd4b8
child 178 afd8c5647c93
equal deleted inserted replaced
-1:000000000000 0:7a0b409fd4b8
       
     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 # import standard library
       
    16 
       
    17 # import interfaces
       
    18 
       
    19 # import packages
       
    20 from pyams_form.form import FormSelector
       
    21 
       
    22 
       
    23 def include_package(config):
       
    24     """Pyramid include"""
       
    25 
       
    26     # add translations
       
    27     config.add_translation_dirs('pyams_form:locales')
       
    28 
       
    29     # custom subscriber predicate
       
    30     config.add_subscriber_predicate('form_selector', FormSelector)
       
    31 
       
    32     # load registry components
       
    33     config.scan()
       
    34 
       
    35     if hasattr(config, 'load_zcml'):
       
    36         config.load_zcml('configure.zcml')