src/pyams_gis/include.py
changeset 0 c73bb834ccbe
child 18 8eef3d17a06f
equal deleted inserted replaced
-1:000000000000 0:c73bb834ccbe
       
     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_gis:locales')
       
    28 
       
    29     # define JSON-RPC endpoint
       
    30     config.add_jsonrpc_endpoint('gis', '/api/gis/json')
       
    31 
       
    32     # load registry components
       
    33     try:
       
    34         import pyams_zmi
       
    35     except ImportError:
       
    36         config.scan(ignore='pyams_gis.zmi')
       
    37     else:
       
    38         config.scan()