diff -r 000000000000 -r 47700a43ef3f src/pyams_thesaurus/include.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_thesaurus/include.py Tue Apr 14 17:52:05 2015 +0200 @@ -0,0 +1,41 @@ +# +# 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""" + + # add translations + config.add_translation_dirs('pyams_thesaurus:locales') + + # define JSON-RPC endpoint + config.add_jsonrpc_endpoint('thesaurus', '/api/thesaurus/json') + + # load registry components + try: + import pyams_zmi + except ImportError: + config.scan(ignore='pyams_thesaurus.zmi') + else: + config.scan() + + if hasattr(config, 'load_zcml'): + config.load_zcml('configure.zcml')