Navigation Menu

Skip to content

Commit

Permalink
Don't assume that owslib >= 0.20 is available
Browse files Browse the repository at this point in the history
Fixes #38074
  • Loading branch information
nyalldawson committed Jun 13, 2021
1 parent c100c5d commit eb1a55a
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions python/plugins/MetaSearch/dialogs/maindialog.py
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit eb1a55a

Please sign in to comment.