mirror of
ssh://devgit.janware.com/janware/proj/jw-python
synced 2026-06-18 05:46:37 +02:00
6 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ad67dd3832 | |||
| e48fa1b00a | |||
| a85f0929c6 | |||
| 6123a68195 | |||
| 6dd594d47b | |||
| fd125f07fe |
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
| ad67dd3832 |
jwutils.Cmds: Beautify log invocations
Add from jwutils import log to avoid unnecessary jwutils.log module path. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| e48fa1b00a |
Cmds.py: Add early evaluation of --log-xxx
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. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| a85f0929c6 |
Consistently replace def run() by async def run()
Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| 6123a68195 |
Cmds.py: Run all commands in asyncio event loop
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. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| 6dd594d47b |
Fix multiple Python 3 compatibility issues
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> |
|||
| fd125f07fe |
Add class Cmds
run_sub_commands() was the only way to access subcommands up to now, Cmds.run() adds another interface, an object as a place to add customizations affecting all commands, e.g. global command line options. Signed-off-by: Jan Lindemann <jan@janware.com> |