Skip to content

Commit

Permalink
rename found_xml param
Browse files Browse the repository at this point in the history
fix flake8 error
  • Loading branch information
pvgenuchten committed Apr 4, 2024
1 parent fcd59f0 commit 68cb141
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions owslib/catalogue/csw2.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,11 @@ def getdomain(self, dname, dtype='parameter'):
# get the list of values associated with the Domain
self.results['values'] = []

for f in self._exml.findall(util.nspath_eval('csw:DomainValues/csw:ListOfValues/csw:Value', namespaces)):
self.results['values'].append(util.testXMLValue(f))
for f in self._exml.findall(
util.nspath_eval('csw:DomainValues/csw:ListOfValues/csw:Value', namespaces)):
self.results['values'].append(util.testXMLValue(f))
except Exception:
self.results['values'] = []
self.results = {'values': []}

def getrecords(self, qtype=None, keywords=[], typenames='csw:Record', propertyname='csw:AnyText', bbox=None,
esn='summary', sortby=None, outputschema=namespaces['csw'], format=outputformat, startposition=0,
Expand Down Expand Up @@ -664,16 +665,16 @@ def _invoke(self):
post_verbs = [x for x in op.methods if x.get('type').lower() == 'post']
if len(post_verbs) > 1:
# Filter by constraints. We must match a PostEncoding of "XML"
foundXML = False
found_xml = False
for pv in post_verbs:
for const in pv.get('constraints'):
if const.name.lower() == 'postencoding':
values = [v.lower() for v in const.values]
if 'xml' in values:
request_url = pv.get('url')
foundXML = True
found_xml = True
break
if not foundXML: # Well, just use the first one.
if not found_xml: # Well, just use the first one.
request_url = post_verbs[0].get('url')
elif len(post_verbs) == 1:
request_url = post_verbs[0].get('url')
Expand Down

0 comments on commit 68cb141

Please sign in to comment.