4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7eb15f2477 | |||
| d50a33d9ab | |||
| f175f9d5c9 | |||
| 0be02c7154 |
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
| 7eb15f2477 |
jw.pkg.lib: Don't log {e}
Don't log an Exception as {e} but as str(e) producing nicer output. Or as repr(e) if a backtrace is requested, because to people who can read backtraces, type info might be of interest. Also, remove pointless time stamps, those belong into the logging framework. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| d50a33d9ab |
jw.pkg.cmds.lib.Cmd: Define run()
Define run(), which calls _run() in the abstract base class Cmd, not in lib.Cmd. Otherwise lib.Cmd is not abstract, which will predictably confuse including code outside of jw-pkg. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| f175f9d5c9 |
lib.Cmd: Add argument "parent" to __init__()
During __init__(), commands have no idea of their parent. This is not a problem as of now, but is easy to fix, and it's architecturally desirable to be prepared just in case, so add the parent argument to the ctor before more commands are added. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| 0be02c7154 |
lib.App, .Cmd: Add modules
Add App and Cmd as generic base classes for multi-command applications. The code is taken from jw-python: The exising jw.pkg.App is very similar to the more capable jwutils.Cmds class, so, to avoid code duplication, add it here to allow for jwutils.Cmds and jw.pkg.App to derive from it at some point in the future. Both had to be slightly modified to work within jw-pkg's less equipped context, and will need futher code cleanup. Signed-off-by: Jan Lindemann <jan@janware.com> |