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

Function get_region_info

tools/python/mwm/mwm_python.py:297–311  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

295
296
297def get_region_info(path):
298 m = MwmPython(path)
299 if not m.has_tag("rgninfo"):
300 return {}
301
302 region_info = {}
303 m.seek_tag("rgninfo")
304 sz = read_varuint(m.file)
305 for _ in range(sz):
306 t = read_varuint(m.file)
307 field = mi.RegionDataField(t)
308 region_info[field] = read_string(m.file)
309 if t == mi.RegionDataField.languages:
310 region_info[field] = [mi.LANGS[ord(x)] for x in region_info[field]]
311 return region_info
312
313
314def read_point(f, base_point: mi.Point, packed: bool = True) -> mi.Point:

Callers

nothing calls this directly

Calls 5

has_tagMethod · 0.95
seek_tagMethod · 0.95
MwmPythonClass · 0.85
read_varuintFunction · 0.85
read_stringFunction · 0.85

Tested by

no test coverage detected