Skip to content

Add line breaks at the end of operations in a stream #9

@Derek-Jones

Description

@Derek-Jones

Adding line breaks at the end of some operations makes the stream much easier to read.
Suggest the following changes to print_stream_content

def printable_stream_content(content_stream: bytes, escape = True) -> str:
    """."""
    ret = ''
    c = content_stream
    for i in range(len(c)):
        if c[i] < 20 and c[i] != 10 and c[i] != 13:
            return None
    ret = c.decode('latin-1')
    ret = ret.replace(' c ', ' c\n')
    ret = ret.replace(' l ', ' l\n')
    ret = ret.replace(' m ', ' m\n')
    ret = ret.replace(' w ', ' w\n')
    ret = ret.replace(' m ', ' m\n')
    ret = ret.replace(' BT ', '\nBT ')
    ret = ret.replace(' ET ', ' ET\n')
    if escape:
        ret = ret.replace('<', '&lt;')
        ret = ret.replace('>', '&gt;')
    return ret

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions