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
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.
As opposed to the C++ variant, StringTree.value() doesn't take a path argument, but only returns the value of the node it's called on. Change this. Returns None if the path is not found.
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.
jwutils.Cmd.add_subcommands() had two issues. First, it failed for more than one command, and with that fixed, it only added the first command of a list of commands passed as an argument. This commit fixes both issues and leaves some logging and cleanup in place, which was used during debugging.
StringTree.__getitem__() returned the node, now return its value child instead. That's nicer and closer to the expected behaviour, as it supports StringTree usage as a key-value store for configuration or so. It breaks the existing API, but I think I have fixed the only pace where it was used: jw-grammar/grammar.py.
Cmds.cmds was sometimes empty, so fix that and make sure it points to the Cmds instance it was crated by. Actually the name of the Cmds class is a bad pick, should have been App or something, so to add .app, too, as a path for future compatibility.
jwutils.log.set_flags() and .set_level() is not set until after all commands are loaded. This can make debugging complicated. OTOH, command-line parsing is also not done until all commands are loaded, because they define the command line options. This commit adds some poor man's command line parsing for fetching --log-level and --log-flags only, and applying them before the commands are all loaded.
Add support for adding children of type StringTree. If a StringTree argument is passed to .add(), this should do the right thing. It makes use of the newly added .__add_children() method and involves quite a bit of hairy case distinctions.
parse() and read() up to present automatically set the root content of a StringTree object to "root". This can now be optionally defined by the "root_content" keyword argument.
- 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)
This commit makee Cmds run all sub-commands in an asyncio event loop. The event loop is currently passed to the commands, which seems unnecessary and looks like it's using a feature which is bound to be deprecated in the future.
object_builtin_name() is meant to derive an object name from its class name. Doesn't work well, but adding the code nonetheless for improving it later.
This commit flips some more switches from Python 2 to Python 3 in makefiles and Python code. Build runs through, but it's still likely to break things.
syntax, i.e. non-assignments, without equal sign. Half-baked, but still better than before. Also support some more Python 3, i.e. dict.items() instead of iteritems()