def version(self) -> mi.MwmVersion: v = self.mwm.version() return mi.MwmVersion( format=int(v.format()) + 1, seconds_since_epoch=v.seconds_since_epoch(), version=v.version(), )
def _read_version(self) -> mi.MwmVersion: self.seek_tag("version") # Skip prolog. self.file.read(4) fmt = read_varuint(self.file) + 1 seconds_since_epoch = read_varuint(self.file) vdate = datetime.fromtimestamp(seconds_since_epoch) version = int(vdate.strftime("%y%m%d")) return mi.MwmVersion( format=fmt, seconds_since_epoch=seconds_since_epoch, version=version )