cmt

cmt.a_converter

class cmt.a_converter.AConverter

Bases: abc.ABC

abstract static convert(source)

Convert to the other map format of same version.

Return type

AMap

abstract static downgrade(source)

Downgrade to the format version below.

Return type

AMap

abstract static upgrade(source)

Upgrade to the format version above.

Return type

AMap

cmt.a_map

class cmt.a_map.AMap(identifier, version)

Bases: abc.ABC

abstract classmethod decode(data, offset, debug=False)
Return type

AMap

abstract encode()
Return type

bytearray

class cmt.a_map.MapType(value)

Bases: enum.Enum

An enumeration.

CMAP = 'celaria_map'
ECMAP = 'celaria_edi'
static from_str(text)
Return type

MapType

cmt.convert

cmt.convert.convert(source, version, target)

First convert to the target type and down/upgrade to the correct version. :raises ValueError: something failed

Return type

AMap

cmt.decode

raises ValueError

something failed

rtype

AMap

cmt.encode

cmt.static_data

cmt.utils

class cmt.utils.DebugIterUnpack(format_, buffer, what)

Bases: object

cmt.utils.debug_print(data, what, value, offset=None)
cmt.utils.to_hex(data)
cmt.utils.unpack_from(format_, buffer, offset, what, debug)

Same behaviour as struct.unpack_from.

Parameters
  • format

  • buffer (bytes) –

  • offset (int) –

  • what (Tuple[str, …]) – tuple of message for every unpacked value

  • debug (bool) – use debug mode

Returns