Skip to content
Permalink
Browse files
Don't assume that owslib >= 0.20 is available
Fixes #38074
  • Loading branch information
nyalldawson committed Jun 13, 2021
1 parent c100c5d commit eb1a55a146d1dddb7ddf52da9c961e4c5a8cce96
Showing with 23 additions and 9 deletions.
  1. +23 −9 python/plugins/MetaSearch/dialogs/maindialog.py
@@ -857,10 +857,17 @@ def show_metadata(self):

try:
with OverrideCursor(Qt.WaitCursor):
cat = CatalogueServiceWeb(self.catalog_url, timeout=self.timeout, # spellok
username=self.catalog_username,
password=self.catalog_password,
auth=auth)
if auth is not None:
cat = CatalogueServiceWeb(self.catalog_url, timeout=self.timeout, # spellok
username=self.catalog_username,
password=self.catalog_password,
auth=auth)
else:
# older owslib version without the auth keyword
cat = CatalogueServiceWeb(self.catalog_url, timeout=self.timeout, # spellok
username=self.catalog_username,
password=self.catalog_password)

cat.getrecordbyid(
[self.catalog.records[identifier].identifier])
except ExceptionReport as err:
@@ -947,11 +954,18 @@ def _get_csw(self):
# connect to the server
with OverrideCursor(Qt.WaitCursor):
try:
self.catalog = CatalogueServiceWeb(self.catalog_url, # spellok
timeout=self.timeout,
username=self.catalog_username,
password=self.catalog_password,
auth=auth)
if auth is not None:
self.catalog = CatalogueServiceWeb(self.catalog_url, # spellok
timeout=self.timeout,
username=self.catalog_username,
password=self.catalog_password,
auth=auth)
else:
# older owslib version without the auth keyword
self.catalog = CatalogueServiceWeb(self.catalog_url, # spellok
timeout=self.timeout,
username=self.catalog_username,
password=self.catalog_password)
return True
except ExceptionReport as err:
msg = self.tr('Error connecting to service: {0}').format(err)

0 comments on commit eb1a55a

Please sign in to comment.