Commit 6dd147e1 authored by Eric Duminil's avatar Eric Duminil
Browse files

Relative to absolute, if needed

parent 1f2dd799
import xml.etree.ElementTree as ET
from datetime import datetime
from urllib.parse import urljoin
from citygml_download import TMP_DIR, Bundesland, download_file
from zipfile_download import ZipFile
......@@ -23,8 +24,8 @@ def parse_atom_georss(bundesland: Bundesland) -> list[ZipFile]:
raise ValueError("No date has been found")
source_date = datetime.strptime(updated_date, "%Y-%m-%dT%H:%M:%SZ")
for file_elem in root.findall("atom:entry/atom:link", ns):
# FIXME: href can be relative too. To what?
href = file_elem.attrib["href"]
href = urljoin(bundesland.source, href)
# TODO: Check if source_date is specified for each ZipFile
if href.endswith(".zip"):
zip_files.append(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment