jw.pkg.App: Code beautification

Major - but not yet sufficient - code beautification starting from jw.pkg.App.

- Make more methods private - Rename methods to be more self-explanatory - Same for method arguments, notably clean up some inconsistent uses of "module" vs "project" - Add more type hints

Fix API breakage in the command modules.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-01-29 10:58:51 +01:00
commit 6ca4af77d7
12 changed files with 204 additions and 209 deletions

View file

@ -20,7 +20,7 @@ class CmdLdflags(Cmd): # export
# -L needs to contain more paths than libs linked with -l would require
def __get_ldpathflags(self, names: list[str], exclude: list[str] = []) -> str:
deps = self.app.get_modules_from_project_txt(names, ['pkg.requires.jw'], 'build',
deps = self.app.get_project_refs(names, ['pkg.requires.jw'], 'build',
scope = Scope.Subtree, add_self=True, names_only=True)
ret = []
for m in deps:
@ -38,7 +38,7 @@ class CmdLdflags(Cmd): # export
return(' '.join(ret))
async def _run(self, args: Namespace) -> None:
deps = self.app.get_modules_from_project_txt(args.module, ['pkg.requires.jw'], 'build',
deps = self.app.get_project_refs(args.module, ['pkg.requires.jw'], 'build',
scope = Scope.One, add_self=args.add_self, names_only=True)
out = []
for m in reversed(deps):