def parse(Self, file): xml = Tag.parse(file) return Self( width = xml['width'], height = xml['height'], groups = list( element for element in xml.tags if element.name == 'g' ), defs = dict( (element['id'], element) for element in xml[Name('defs')].tags ), )
def parse(file): return Tag.parse(file)