Skip to content

Commit

Permalink
merge OWSLib 0.8.10 CSW fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Nov 5, 2014
1 parent fbc47d1 commit 98c9ec7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/ext-libs/owslib/csw.py
Expand Up @@ -8,7 +8,7 @@
# ============================================================================= # =============================================================================


""" CSW request and response processor """ """ CSW request and response processor """

import inspect
import warnings import warnings
import StringIO import StringIO
import random import random
Expand Down Expand Up @@ -591,7 +591,10 @@ def _invoke(self):
# If skip_caps=True, then self.operations has not been set, so use # If skip_caps=True, then self.operations has not been set, so use
# default URL. # default URL.
if hasattr(self, 'operations'): if hasattr(self, 'operations'):
for op in self.operations: caller = inspect.stack()[1][3]
if caller == 'getrecords2': caller = 'getrecords'
try:
op = self.get_operation_by_name(caller)
post_verbs = filter(lambda x: x.get('type').lower() == 'post', op.methods) post_verbs = filter(lambda x: x.get('type').lower() == 'post', op.methods)
if len(post_verbs) > 1: if len(post_verbs) > 1:
# Filter by constraints. We must match a PostEncoding of "XML" # Filter by constraints. We must match a PostEncoding of "XML"
Expand All @@ -602,6 +605,8 @@ def _invoke(self):
xml_post_url = post_verbs[0].get('url') xml_post_url = post_verbs[0].get('url')
elif len(post_verbs) == 1: elif len(post_verbs) == 1:
xml_post_url = post_verbs[0].get('url') xml_post_url = post_verbs[0].get('url')
except: # no such luck, just go with xml_post_url
pass


self.request = cleanup_namespaces(self.request) self.request = cleanup_namespaces(self.request)
# Add any namespaces used in the "typeNames" attribute of the # Add any namespaces used in the "typeNames" attribute of the
Expand Down

0 comments on commit 98c9ec7

Please sign in to comment.