Skip to content

Commit 05a9636

Browse files
committedNov 5, 2014
merge OWSLib 0.8.10 CSW fix
geopython/OWSLib@4e5e248
1 parent fcc8a00 commit 05a9636

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎python/ext-libs/owslib/csw.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# =============================================================================
99

1010
""" CSW request and response processor """
11-
11+
import inspect
1212
import warnings
1313
import StringIO
1414
import random
@@ -591,7 +591,10 @@ def _invoke(self):
591591
# If skip_caps=True, then self.operations has not been set, so use
592592
# default URL.
593593
if hasattr(self, 'operations'):
594-
for op in self.operations:
594+
caller = inspect.stack()[1][3]
595+
if caller == 'getrecords2': caller = 'getrecords'
596+
try:
597+
op = self.get_operation_by_name(caller)
595598
post_verbs = filter(lambda x: x.get('type').lower() == 'post', op.methods)
596599
if len(post_verbs) > 1:
597600
# Filter by constraints. We must match a PostEncoding of "XML"
@@ -602,6 +605,8 @@ def _invoke(self):
602605
xml_post_url = post_verbs[0].get('url')
603606
elif len(post_verbs) == 1:
604607
xml_post_url = post_verbs[0].get('url')
608+
except: # no such luck, just go with xml_post_url
609+
pass
605610

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

0 commit comments

Comments
 (0)
Please sign in to comment.