Skip to content
Permalink
Browse files
Don't assume that owslib >= 0.20 is available
Fixes #38074
  • Loading branch information
nyalldawson committed Jun 10, 2021
1 parent e70cf8d commit 3cf9083743de2a72893d2efeddcfb29f3ea7130f
Showing with 23 additions and 9 deletions.
  1. +23 −9 python/plugins/MetaSearch/dialogs/maindialog.py
@@ -856,10 +856,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:
@@ -946,11 +953,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 3cf9083

Please sign in to comment.