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_tileset(node, firstgid=None):
"""
parse a tileset element and return a tileset object and properties for tiles as a dict
"""
tileset = TiledTileset()
set_properties(tileset, node)
tiles = {}
if firstgid != None:
tileset.firstgid = firstgid
# since tile objects probably don't have a lot of metadata,
# we store it separately from the class itself
for child in node.childNodes:
if child.nodeName == "tile":
p = get_properties(child)
gid = p["id"] + tileset.firstgid
del p["id"]
tiles[gid] = p
# check for tiled "external tilesets"