Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def parse_map(node):
"""
parse a map node from a tiled tmx file
return a tiledmap
"""
tiledmap = TiledMap()
tiledmap.filename = filename
set_properties(tiledmap, map_node)
for node in map_node.getElementsByTagName("tileset"):
t, tiles = parse_tileset(node)
tiledmap.tilesets.append(t)
tiledmap.tile_properties.update(tiles)
for node in dom.getElementsByTagName("layer"):
l = parse_layer(tiledmap.tilesets, node)
tiledmap.tilelayers.append(l)
tiledmap.layers.append(l)
for node in dom.getElementsByTagName("objectgroup"):
o = parse_objectgroup(node)
tiledmap.objectgroups.append(o)