Skip to content

Commit

Permalink
fix: self.data is now a list to be consistent with the other parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
rsavoye committed Jun 30, 2024
1 parent 812d273 commit 5452e7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions osm_fieldwork/osmfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(
self.start = -1
# path = xlsforms_path.replace("xlsforms", "")
self.convert = Convert()
self.data = dict()
self.data = list()

def __del__(self):
"""Close the OSM XML file automatically."""
Expand Down Expand Up @@ -154,7 +154,7 @@ def createWay(
if "version" not in way["attrs"]:
attrs["version"] = 1
else:
attrs["version"] = way["attrs"]["version"] + 1
attrs["version"] = way["attrs"]["version"]
attrs["timestamp"] = datetime.now().strftime("%Y-%m-%dT%TZ")
# If the resulting file is publicly accessible without authentication, The GDPR applies
# and the identifying fields should not be included
Expand Down Expand Up @@ -399,7 +399,7 @@ def loadFile(
tags[node["tag"]["@k"]] = node["tag"]["@v"].strip()
# continue
node = {"attrs": attrs, "tags": tags}
self.data[node["attrs"]["id"]] = node
self.data.append(node)
return self.data

def dump(self):
Expand Down

0 comments on commit 5452e7d

Please sign in to comment.