6 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 18c16917b2 | |||
| a160555596 | |||
| d50a33d9ab | |||
| 9c06103a4a | |||
| f175f9d5c9 | |||
| 0b83c863a2 |
Renamed from src/python/jw/pkg/build/Cmd.py (Browse further)
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
| 18c16917b2 |
App, .cmds.Cmd: Add .distro property
DistroBase's option --id is now redundant to the new global option --distro-id in the App class, so remove --id. The only added value DistroBase then brings to the table is its .distro property, which can be provided by App just fine at this point, given that App has all it needs to construct a Distro object, so add .distro to App and remove the entire DistroBase class. For convenience, also make App.distro available as a newly added cmds.Cmd.distro property. This also obviates the need for the distro-related properties in the .distro.Cmd class, remove all that. Signed-off-by: Jan Lindemann <jan@janware.com> |
|||
| a160555596 |
jw.pkg.cmds.Cmd._add_subcommands(): Generic detection
Deduce module search path for the calling module's subcommands directly from the module path of the calling module. That's more generic than the previous detection algorithm, because it recursively works for subcommands of subcommands as well. 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> |
|||
| 9c06103a4a |
cmds.project.*: Make _run() async
Cmd._run(), as conceived for working with lib.App, is meant to be an async method. To be conservative about changes, jw-pkg's legacy way of handling _run() was kept when deriving from libApp, and async was not propagated down to the _run() implementations. This commit rectifies that before adding additional subcommands. 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> |
|||
| 0b83c863a2 |
jw.build.cmds: Move build.cmds -> cmds.projects
Reorganize the Python module structure. Placing the command classes under jw.cmds.projects instead of jw.build.cmds will allow to add a nested command structure, with the current commands, being mostly related to building software, found below a "projects" toplevel command. Other conceivable commands could be "package" for packaging, or "distro" for commands wrapping the distribution's package manager. Signed-off-by: Jan Lindemann <jan@janware.com> |