Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Merges ASTM message `chunks` into single message.

:param chunks: List of chunks as `bytes`.
:type chunks: iterable

        def join(chunks):
    """Merges ASTM message `chunks` into single message.

    :param chunks: List of chunks as `bytes`.
    :type chunks: iterable
    """
    msg = b'1' + b''.join(c[2:-5] for c in chunks) + ETX
    return b''.join([STX, msg, make_checksum(msg), CRLF])
        


src/a/s/astm-0.5.0/astm/tests/test_codecs.py   astm(Download)
    def test_join_chunks(self):
        recs = [['foo', '1'], ['bar', '24'], ['baz', ['1', '2', '3'], 'boo']]
        chunks = codec.encode(recs, size=14)
        msg = codec.join(chunks)
        self.assertEqual(codec.decode(msg), recs)