Geonetwork 2.10.x (#14)

* first commit for the CKAN 2.10 upgrade

* upgrading the MEF part in utils.py

* update GN for CKAN 2.10

* using info.xml again instead of metadata.xml

---------

Co-authored-by: gpetrak <gkpetrak@gmail.com>
This commit is contained in:
Emanuele Tajariol 2024-11-12 10:59:11 +01:00 committed by GitHub
parent c5ed4e55d3
commit babc26e90f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 13 deletions

View File

@ -32,16 +32,7 @@ class GeoNetworkClient(object):
logger.info('URL %r ', url)
#headers = {
# "Content-Type": "application/x-www-form-urlencoded",
# "Accept": "text/plain"
#query = urllib.parse.urlencode({
# "uuid": uuid
#}).encode('utf-8')
request = urllib.request.Request(url, method='GET')
opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(), urllib.request.HTTPRedirectHandler())
response = opener.open(request) # will get a ZIP file
@ -67,10 +58,8 @@ class GeoNetworkClient(object):
xml = self.retrieveInfo(uuid)
cats = []
for cat in xml.iter('{http://www.isotc211.org/2005/gmd}MD_TopicCategoryCode'):
cat = cat.text
for cat in xml.findall('categories/category'):
logger.info('cat %r', cat)
cats.append(cat)
cats.append(cat.get('name'))
return cats