source: cows/trunk/cows/pylons/templates/exception_report.xml @ 4032

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows/trunk/cows/pylons/templates/exception_report.xml@4032
Revision 4032, 1.1 KB checked in by spascoe, 11 years ago (diff)

Missing import changes.

Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<?python
3"""
4A OWS exception report.
5
6@param report: An cows.exception_report object
7"""
8
9def hide_optionals(attrDict, optionals=None):
10    """
11    Returns a copy of attrDict where any value which is None and in optionals is removed.
12
13    If optionals=None all keys are considered optional.
14
15    @todo: move this to a utils module
16    """
17    od = {}
18    for key, value in attrDict.items():
19        if (value is not None) or (optionals and key not in optionals):
20            od[key] = value
21
22    return od
23?>
24<ExceptionReport xmlns="http://www.opengis.net/ows"
25                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
26                 xmlns:py="http://genshi.edgewall.org/"
27                 xsi:schemaLocation="http://www.opengis.net/ows owsExceptionReport.xsd"
28                 version="${report.version}"
29                 py:attrs="hide_optionals(dict(language=report.lang))">
30<!-- generated from genshi -->
31<Exception py:for="e in report.exceptions"
32           py:content="e.text"
33           exceptionCode="${e.code}"
34           py:attrs="hide_optionals(dict(locator=e.locator))"/>
35</ExceptionReport>
36                 
Note: See TracBrowser for help on using the repository browser.