Support property edit_columns, intended to populate forms where rows
are created or edited, defaulting to log_columns.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add the following methods:
add_child_row_location(self, parent_table: Union[Self, str], **kwargs) -> Optional[str]
add_child_row_location_rules(self) -> Iterable[str]
add_child_row_location_rule(self, child_table: Union[Self, str]) -> Optional[str]
These are meant to be called from different pieces of code:
- add_child_row_location() is meant to be used where the parent is
rendered, to display a link to adding another child
- add_child_row_location_rules() and add_child_row_location_rule()
are meant to be invoked where processing is going to be done, i.e.
likely code rendering child row content
Signed-off-by: Jan Lindemann <jan@janware.com>
Config.branch(path) just silently returns the entire tree if path
doesn't exist in the config. Fix that.
Signed-off-by: Jan Lindemann <jan@janware.com>
refuse_mode_mask can be passed to the constructor and determines
which permission bits need to be absent from config file modes if
they smell like they contain secrets.
Signed-off-by: Jan Lindemann <jan@janware.com>
Make Config's ctor accept strings as values for glob_paths, as
opposed to lists. This covers the canonical case of one configuration
file being passed.
Signed-off-by: Jan Lindemann <jan@janware.com>
The parsed args container is passed to the run() function and friends
for convenient use. Sometimes, though, the base classes or umbrella
commands need to make use of it, too, even more so as they may define
command line arguments via add_arguments(). However, run() or _run()
or whatever is never called on them, neither any other callback, so
make args available to them as a member variable.
Signed-off-by: Jan Lindemann <jan@janware.com>
Initializing Config from a StringTree object doesn't stop it from
looking for config files to read. Stop that.
Signed-off-by: Jan Lindemann <jan@janware.com>
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>
child_list() throws an exception saying that <str> has no to_list()
method. No, it hasn't. No idea how this has even worked at all, ever.
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>