source: TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/pylons/model.py @ 3548

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/pylons/model.py@3548
Revision 3548, 585 bytes checked in by spascoe, 12 years ago (diff)

Added a simple data interface for WMS. This may not live in ows_common
in the long term but is the most convenient place to put it for now.

Line 
1"""
2A module for storing Pylons model information for use by ows_common
3code.
4
5"""
6
7from ows_common.service.wms_iface import ILayerMapper
8
9#
10# The layerMapper is the link between the simpleified layer interface and
11# the pylons controllers.
12#
13_layerMapper = None
14
15def getLayerMapper():
16    if _layerMapper is None:
17        raise RuntimeError("No layerMapper registered")
18    else:
19        return _layerMapper
20
21def setLayerMapper(lm):
22    if not isinstance(lm, ILayerMapper):
23        raise TypeError("Object %s does not implement ILayerMapper" % lm)
24    else:
25        _layerMapper = lm
Note: See TracBrowser for help on using the repository browser.