def __init__(self, mode='be'): ''' :type mode: str :param mode: mode of binary encoding. 'le' for little endian, 'be' for big endian, '' for non-byte aligned ''' kassert.is_in(mode, ['be', 'le']) super(BitFieldMultiByteEncoder, self).__init__() self._mode = mode
def __init__(self, fmt): ''' :param fmt: format for encoding (from BitFieldAsciiEncoder.formats) ''' kassert.is_in(fmt, BitFieldAsciiEncoder.formats) self._fmt = fmt