# HG changeset patch # User Thierry Florac # Date 1482849576 -3600 # Node ID 57b52bddde7f16ff1a7d6cefe13f73a2c29bd254 # Parent 58686bb1a7b9c3432fb4a0b69cc6343a467c2e34 Updated package include diff -r 58686bb1a7b9 -r 57b52bddde7f src/pyams_file/__init__.py --- a/src/pyams_file/__init__.py Tue Nov 15 09:55:02 2016 +0100 +++ b/src/pyams_file/__init__.py Tue Dec 27 15:39:36 2016 +0100 @@ -23,13 +23,6 @@ # add translations config.add_translation_dirs('pyams_file:locales') - # load registry components - try: - import pyams_zmi - except ImportError: - config.scan(ignore='pyams_file.zmi') - else: - config.scan() - - if hasattr(config, 'load_zcml'): - config.load_zcml('configure.zcml') + # load components + from .include import include_package + include_package(config) diff -r 58686bb1a7b9 -r 57b52bddde7f src/pyams_file/include.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_file/include.py Tue Dec 27 15:39:36 2016 +0100 @@ -0,0 +1,35 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces + +# import packages + + +def include_package(config): + """Pyramid include""" + + # load registry components + try: + import pyams_zmi + except ImportError: + config.scan(ignore='pyams_file.zmi') + else: + config.scan() + + if hasattr(config, 'load_zcml'): + config.load_zcml('configure.zcml')