def read_file(self, file_path): tar = Tarball(file_path) doc = dom.parseString(tar.read(tar.getnames()[0])) top_element = doc.documentElement self.set_title(top_element.getAttribute("title")) self._mode = int(top_element.getAttribute("mode")) self._main_area.set_mode(self._mode) self._main_area.load_thyself(top_element, doc, tar) if top_element.hasAttribute("scale_factor"): fac = float(top_element.getAttribute("scale_factor")) self._main_area.scale_fac = fac if top_element.hasAttribute("translation"): tmp = top_element.getAttribute("translation") x, y = utils.parse_coords(tmp) self._main_area.translation = [x, y] tar.close()