Skip to content

2.9.0 - Added tail, io_tail, and reverse_io functions. Fixed some unit tests

Compare
Choose a tag to compare
@Someguy123 Someguy123 released this 17 Mar 22:45
· 33 commits to master since this release

Added in main commit 48ce4b6

  • Added common.reverse_io function, allows reading blocks of bytes from files from the end of the file efficiently.

  • Added common.io_tail function, a pure python generator function, which works similarly to UNIX tail, and
    efficiently reads the file from the end, instead of having to load the entire file to access the last lines.

  • Added common.tail function, which is a simple wrapper around io_tail - to simplify usage when tailing a relatively small ( < 10k lines? )
    amount of lines. Iterates over io_tail, loading each chunk into memory, and correctly orders the lines for immediate usage of the returned list.

  • Added io_tail, reverse_io and tail to the docs.

  • Added thorough unit tests for io_tail and tail

  • Minor cleanup of whitespace in common.py

Additional commit to fix unit tests 47345a2

  • tests.test_net.TestNet._check_asn now allows comparing against multiple AS names,
    reducing risk of ASN test breakage due to AS names changing.

  • Added additional AS names to test_asn_to_name_int and test_asn_to_name_str to repair
    test breakage caused by Cloudflare's AS name changing, and preventing breakage caused by
    AS name changes in future.