cmt

cmt.a_converter

class cmt.a_converter.AConverter

Bases: abc.ABC

abstract static convert_to(source, target)

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

Bases: enum.Enum

An enumeration.

CMAP = 'celaria_map'
ECMAP = 'celaria_edi'
from_str(text) = <function MapType.from_str>

cmt.convert

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

ValueError – something failed

Return type

Union[CMap, CMap, ECMap, ECMap]

cmt.decode

cmt.decode.decode(file, debug=False)
Raises

ValueError – something failed

Return type

Union[CMap, CMap, ECMap, ECMap]

cmt.encode

cmt.encode.encode(source, file)

cmt.static_data

Static and important data which is needed by the program and do not need any third party libraries. (this is important because it is used inside the setup.py.

cmt.static_data.AUTHOR = 'Iceflower S'

author

cmt.static_data.AUTHOR_EMAIL = 'iceflower@gmx.de'

author email

cmt.static_data.DESCRIPTION = 'Celeria Map Toolkit, can convert different map formats from one into another.'

short description

cmt.static_data.LONG_NAME = 'Celaria Map Toolkit'

long name of this program

cmt.static_data.NAME = 'CMT'

name of this program

cmt.static_data.PROJECT_URL = 'https://github.com/IceflowRE/cmt'

project url

cmt.static_data.VERSION = '0.3.0.dev1'

version in PEP440 format

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