diff --git a/src/python/jw/pkg/lib/App.py b/src/python/jw/pkg/lib/App.py index c9fab8e0..54c6abec 100644 --- a/src/python/jw/pkg/lib/App.py +++ b/src/python/jw/pkg/lib/App.py @@ -292,8 +292,8 @@ class App: # export self.__async_runner = None return ret -def run_sub_commands( +def run_sub_commands( # export description = '', name_filter = '^Cmd.*', modules = None, argv = None -): # export +): app = App(description, name_filter, modules) return app.run(argv = argv) diff --git a/src/python/jw/pkg/lib/ec/SSHClient.py b/src/python/jw/pkg/lib/ec/SSHClient.py index 39a5b4bb..e920a25b 100644 --- a/src/python/jw/pkg/lib/ec/SSHClient.py +++ b/src/python/jw/pkg/lib/ec/SSHClient.py @@ -109,9 +109,9 @@ class SSHClient(ExecContext): def password(self) -> str | None: return self.uri.password -def ssh_client( +def ssh_client( # export *args, type: str | list[str] | None = None, **kwargs -) -> SSHClient: # export +) -> SSHClient: from importlib import import_module errors: list[str] = [] diff --git a/src/python/jw/pkg/lib/pm/dpkg.py b/src/python/jw/pkg/lib/pm/dpkg.py index 6ed15fb9..41596211 100644 --- a/src/python/jw/pkg/lib/pm/dpkg.py +++ b/src/python/jw/pkg/lib/pm/dpkg.py @@ -33,20 +33,20 @@ async def _run( if sudo else await run_cmd(cmd, ec = ec, cmd_input = InputMode.NonInteractive) ).stdout_str -async def run_dpkg( +async def run_dpkg( # export args: list[str], sudo: bool = False, ec: ExecContext | None = None -) -> str: # export +) -> str: cmd = ['/usr/bin/dpkg'] cmd.extend(args) return await _run(cmd, sudo, ec) -async def run_dpkg_query( +async def run_dpkg_query( # export args: list[str], sudo: bool = False, ec: ExecContext | None = None -) -> str: # export +) -> str: cmd = ['/usr/bin/dpkg-query'] cmd.extend(args) return await _run(cmd, sudo, ec) diff --git a/src/python/jw/pkg/lib/pm/rpm.py b/src/python/jw/pkg/lib/pm/rpm.py index b52c8271..8635a9d5 100644 --- a/src/python/jw/pkg/lib/pm/rpm.py +++ b/src/python/jw/pkg/lib/pm/rpm.py @@ -25,13 +25,13 @@ def meta_map(): ) return _meta_map -async def run_rpm( +async def run_rpm( # export args: list[str], sudo: bool = False, ec: ExecContext | None = None, mode: InputMode = InputMode.OptInteractive, **kwargs, -) -> str: # export +) -> str: cmd = ['/usr/bin/rpm'] cmd.extend(args) result = ( @@ -40,10 +40,10 @@ async def run_rpm( ) return result.stdout_str -async def query_packages( +async def query_packages( # export names: Iterable[str] = [], ec: ExecContext | None = None, -) -> Iterable[Package]: # export +) -> Iterable[Package]: fmt_str = ( '|'.join([(f'%{{{tag}}}' if tag else '') for tag in meta_map().values()]) + r'\n' diff --git a/src/python/jw/pkg/lib/util.py b/src/python/jw/pkg/lib/util.py index 3a809305..3390b58b 100644 --- a/src/python/jw/pkg/lib/util.py +++ b/src/python/jw/pkg/lib/util.py @@ -209,12 +209,12 @@ async def copy( return e assert False, 'Unreachable code' -async def get_username( +async def get_username( # export args: Namespace | None = None, url: str | None = None, askpass_env: list[str] = [], ec: ExecContext | None = None, -) -> str | None: # export +) -> str | None: url_user = None if url is None else Uri(url).username if args is not None: if args.username is not None: @@ -228,12 +228,12 @@ async def get_username( return url_user return await run_askpass(askpass_env, AskpassKey.Username, ec = ec) -async def get_password( +async def get_password( # export args: Namespace | None = None, url: str | None = None, askpass_env: list[str] = [], ec: ExecContext | None = None, -) -> str | None: # export +) -> str | None: if args is None and url is None and not askpass_env: raise Exception( 'Neither URL nor command-line arguments nor askpass environment variable ' @@ -251,11 +251,11 @@ async def get_password( return ret return await run_askpass(askpass_env, AskpassKey.Password, ec = ec) -async def get_profile_env( +async def get_profile_env( # export throw: bool = True, keep: Iterable[str] | bool = False, ec: ExecContext | None = None, -) -> dict[str, str]: # export +) -> dict[str, str]: """ Get a fresh environment from /etc/profile