MCPcopy Create free account
hub / github.com/comaps/comaps / __init__

Method __init__

tools/python/mwm/mwm_python.py:21–39  ·  view source on GitHub ↗
(self, filename: str, parse: bool = False)

Source from the content-addressed store, hash-verified

19
20class MwmPython(mi.Mwm):
21 def __init__(self, filename: str, parse: bool = False):
22 super().__init__(filename)
23
24 self.f = open(filename, "rb")
25 self.file = mmap.mmap(self.f.fileno(), 0, access=mmap.ACCESS_READ)
26
27 self.tags = self._read_sections_info()
28
29 self.seek_tag("header")
30 coord_bits = read_varuint(self.file)
31 self.coord_size = (1 << coord_bits) - 1
32 self.base_point = mwm_bitwise_split(read_varuint(self.file))
33 self.bounds_ = read_bounds(self.file, self.coord_size)
34 self.scales = read_uint_array(self.file)
35 self.langs = [mi.LANGS[code] for code in read_uint_array(self.file)]
36 self.map_type = mi.MapType(read_varint(self.file))
37
38 self.version_ = self._read_version()
39 self.metadata_offsets = self._read_metadata_offsets()
40
41 def version(self) -> mi.MwmVersion:
42 return self.version_

Callers

nothing calls this directly

Calls 9

_read_sections_infoMethod · 0.95
seek_tagMethod · 0.95
_read_versionMethod · 0.95
read_varuintFunction · 0.85
mwm_bitwise_splitFunction · 0.85
read_boundsFunction · 0.85
read_uint_arrayFunction · 0.85
read_varintFunction · 0.85

Tested by

no test coverage detected