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:
parent
c5ed4e55d3
commit
babc26e90f
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue