Commit Graph

5 Commits

Author SHA1 Message Date
T. Joseph Carter
db6c481ad6 Significant style improvements for util.py
First, docstrings have been haphazard and inconsistent in blocksfree, that's
going to change.  I don't know rST markup, but I do intend to learn it because
it is a superior format for technical writing.  User-focused docs will remain
in Markdown format.  It's more likely to be read by end-users as text, after
all, and those sorts of docs are the things Markdown is good for.

Rewrote printables() in procedural fashion for clarity.  Would like to have
done that with hexchars(), but that's not actually much clearer when written
procedurally than functionally, so I let be.

Functions now have type hints again.  Those went away when I rewrote this mess
and I didn't put them back.

Finally I renamed the Iterator version of this function to hexdump_gen.
pylint3 objects to the workaround to mixing commits.  Temporary.
2017-07-17 08:46:20 -07:00
T. Joseph Carter
6a91b5eb27 Rewrote hexdump, added gen_hexdump
The nex gen_hexdump returns an Iterator to give you a hex dump one line at a
time.  This is the thing to use (probably) if you want to do something useful
with a hexdump other than print it, say.  The hexdump function now takes
another argument, func, a callable meant to take a string, defaulting to print.
It just uses the Iterator.

I think I'm done messing with the API to this and can soon start actually
committing some code that uses it now and then.  ;)
2017-07-15 13:27:51 -07:00
T. Joseph Carter
3238f05eae Add util module docstring
This is mostly to silence pylint3 about it.
2017-07-15 13:22:59 -07:00
T. Joseph Carter
3eb8d7cade Correct typing and docstring on seqsplit
Type hinting in Python is just that: Hinting.  Which means if you do it wrong,
as long as the syntax is right, Python itself will just let you do it.  Python
is intended to be a duck-typed language, so you're really just documenting you
intent/expectations.  The feature is somewhat new, and its conventions are not
completely understood by certain tools that encounter it.  This apparently
applies to myself as a developer trying to use it. ;)
2017-07-15 10:25:06 -07:00
T. Joseph Carter
eb01d189db Move util functions out of legacy
The util functions consist entirely of hexdump and its helper function right
now, both of which are completely unused at the moment.  I don't intend for
legacy to ever call these functions, but I should start using them soon.  :)
2017-07-08 17:37:15 -07:00