Run
monkeytype run jw-acc.py --log-level debug db import --format mdb-json-dir dbs
monkeytype list-modules | grep ^jw | while read m; do
monkeytype apply $m
done
and fix the fallout.
Signed-off-by: Jan Lindemann <jan@janware.com>
Fix mypy warning
jwutils/log.py:209: error: Incompatible types in assignment
(expression has type int, variable has type Literal[5])
Signed-off-by: Jan Lindemann <jan@janware.com>
Add only_printable keyword argument to slog(). It defaults to False.
If it's true, non-printable characters are not logged but replaced
with a printable character.
Signed-off-by: Jan Lindemann <jan@janware.com>
In addition to an integer, a string can now be passed, which allows
prefix = ' | '
append_to_prefix(prefix)
slog(INFO, "something")
remove_from_prefix(prefx)
Signed-off-by: Jan Lindemann <jan@janware.com>
Add a kwargs keyword argument. This should allow a kwargs containing
a "caller=" argument to be passed to the function and just do the
right thing. Badly tested.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add type annotations as generated by monkeytype and jw-devops/test, plus some
hand editing to satisfy both monkeytype and mypy.
Signed-off-by: Jan Lindemann <jan@janware.com>
- Add functions: append_to_prefix(),
remove_from_prefix() set_filename_length()
- Make slog_m() log one list item per line
- Add console_color_chars(prio)
Signed-off-by: Jan Lindemann <jan@janware.com>
Add leading underscore to variables that should not be visible
outside of log.py. Also do some indentation beautification.
Signed-off-by: Jan Lindemann <jan@janware.com>
Changes in Python 3 that made the code choke:
o basestring is merged into str
o print() needs parentesis
o Class inheritance syntax changed
o Abstract baseclass (ABCMeta) syntax changed
o map.iteritems() is replaced by map.items()
o Inconsistent use of tabs and spaces are no longer tolerated
Signed-off-by: Jan Lindemann <jan@janware.com>
Arguments to --irrelevant-symbols are not meant to be represented in the
AST resulting from parsing.
Also, add pad() to misc.py.
Signed-off-by: Jan Lindemann <jan@janware.com>