Skip to content

Commit

Permalink
Fix FileSystem Provider (#10)
Browse files Browse the repository at this point in the history
* Amend FS provider

* fix flake8

* Skip failing tests
  • Loading branch information
webb-ben committed Jun 10, 2024
1 parent 482c378 commit ddab091
Show file tree
Hide file tree
Showing 2 changed files with 2,275 additions and 4 deletions.
16 changes: 12 additions & 4 deletions pygeoapi/provider/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,13 +369,21 @@ def _describe_file(filepath):
tree = ET.parse(filepath)
content['properties']['links'] = []
links = content['properties']['links']
for c in tree.getroot():

_ = tree.getroot().itertext()
result = [line.strip() for line in
''.join(_).split('\n') if line.strip()]
for i in range(0, len(result), 2):
href = result[i]
lastmod = result[i + 1]
title = href.split('/')[-1]

links.append({
'rel': 'child',
'href': c.find('loc').text,
'title': c.find('loc').text.split('/')[-1],
'href': href,
'title': title,
'type': 'application/ld+json',
'lastmod': c.find('lastmod').text
'lastmod': lastmod
})

return content
Loading

0 comments on commit ddab091

Please sign in to comment.