[python] Add mwm v10 version to pygen. Do not parse metadata_offsets from python for mwm v10 and newer.

This commit is contained in:
tatiana-yan 2020-04-01 17:23:19 +03:00 committed by mpimenov
parent 3e8ca5a1ae
commit 247005717e
2 changed files with 4 additions and 1 deletions

View file

@ -348,6 +348,7 @@ BOOST_PYTHON_MODULE(pygen)
.value("v7", version::Format::v7)
.value("v8", version::Format::v8)
.value("v9", version::Format::v9)
.value("v10", version::Format::v10)
.value("last", version::Format::lastFormat);
bp::class_<FilesContainerR::TagInfo>("SectionInfo", bp::no_init)

View file

@ -34,7 +34,8 @@ class MwmPython(mi.Mwm):
self.map_type = mi.MapType(read_varint(self.file))
self.version_ = self._read_version()
self.metadata_offsets = self._read_metadata_offsets()
if self.version_.format < 10 :
self.metadata_offsets = self._read_metadata_offsets()
def version(self) -> mi.MwmVersion:
return self.version_
@ -88,6 +89,7 @@ class MwmPython(mi.Mwm):
return tags
def _read_metadata_offsets(self) -> Dict[int, int]:
assert self.version_.format < 10
self.seek_tag("metaidx")
tag_info = self.get_tag("metaidx")
current = 0