[Inteproxy-commits] r271 - in trunk: . inteproxy
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Sep 17 20:15:35 CEST 2010
Author: bh
Date: 2010-09-17 20:15:32 +0200 (Fri, 17 Sep 2010)
New Revision: 271
Modified:
trunk/ChangeLog
trunk/inteproxy/transcoder.py
Log:
* inteproxy/transcoder.py
(OWSProxyPOSTTranscoder.wfs_root_elements): New. Moved from
convert_request to class scope. Add the root element names of the
rest of the WFS requests.
(OWSProxyPOSTTranscoder.convert_request): Use wfs_root_elements.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-09-17 14:57:13 UTC (rev 270)
+++ trunk/ChangeLog 2010-09-17 18:15:32 UTC (rev 271)
@@ -1,5 +1,13 @@
2010-09-17 Bernhard Herzog <bh at intevation.de>
+ * inteproxy/transcoder.py
+ (OWSProxyPOSTTranscoder.wfs_root_elements): New. Moved from
+ convert_request to class scope. Add the root element names of the
+ rest of the WFS requests.
+ (OWSProxyPOSTTranscoder.convert_request): Use wfs_root_elements.
+
+2010-09-17 Bernhard Herzog <bh at intevation.de>
+
* inteproxy/config.py, inteproxy/gtkapp.py, inteproxy/main.py,
inteproxy/transcoder.py: Remove unused imports
Modified: trunk/inteproxy/transcoder.py
===================================================================
--- trunk/inteproxy/transcoder.py 2010-09-17 14:57:13 UTC (rev 270)
+++ trunk/inteproxy/transcoder.py 2010-09-17 18:15:32 UTC (rev 271)
@@ -127,13 +127,21 @@
"""Transcoder for POST requests to the OWSProxy"""
+ # The names of the root elements that are used in WFS XML requests.
+ # The namespace notation is that of elementtree.
+ wfs_root_elements = set(("{http://www.opengis.net/wfs}DescribeFeatureType",
+ "{http://www.opengis.net/wfs}GetCapabilities",
+ "{http://www.opengis.net/wfs}GetFeature",
+ "{http://www.opengis.net/wfs}GetGmlObject",
+ "{http://www.opengis.net/wfs}LockFeature",
+ "{http://www.opengis.net/wfs}Transaction"))
+
def convert_request(self, request):
"""Adds user and password attributes to the GetFeature element.
"""
t = etree.parse(StringIO(request.body))
root = t.getroot()
- if root.tag in ("{http://www.opengis.net/wfs}GetFeature",
- "{http://www.opengis.net/wfs}Transaction"):
+ if root.tag in self.wfs_root_elements:
user, password = self.get_password()
root.set("user", user)
root.set("password", password)
More information about the Inteproxy-commits
mailing list