Skip to content

Reading History for New format *.dna file #8

@MinTTT

Description

@MinTTT

Since the *.dna improve the storage of history trees, they compressed the xml tags after the version of 5.0.

I recommend decompress the hex string to read the history of DNA sequence.

        elif ord(next_byte) == 7:
            # read history
            hist_content = fileobject.read(block_size)
            try:
                hist2xml = hist_content.decode("utf-8")
                
            except Exception as e:
                # try to read the history decompress via LZMA
                hist_content_compressed = hist_content
                # print hist_content_compressed as hex 
                print(hist_content_compressed.hex())
                try:
                    hist2xml = lzma.decompress(hist_content_compressed).decode("utf-8")
                except Exception as e:
                    continue

            hist_data = parse_dict(xmltodict.parse(hist2xml))

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