lib: Fix misplaced "# export" markers

A couple of "# export" markers after function prototypes have been
pushed along with the closing parenthesis onto the wrong line by the
code formatter, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-07-24 10:33:42 +02:00
commit dcbe959843
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
5 changed files with 18 additions and 18 deletions

View file

@ -292,8 +292,8 @@ class App: # export
self.__async_runner = None self.__async_runner = None
return ret return ret
def run_sub_commands( def run_sub_commands( # export
description = '', name_filter = '^Cmd.*', modules = None, argv = None description = '', name_filter = '^Cmd.*', modules = None, argv = None
): # export ):
app = App(description, name_filter, modules) app = App(description, name_filter, modules)
return app.run(argv = argv) return app.run(argv = argv)

View file

@ -109,9 +109,9 @@ class SSHClient(ExecContext):
def password(self) -> str | None: def password(self) -> str | None:
return self.uri.password return self.uri.password
def ssh_client( def ssh_client( # export
*args, type: str | list[str] | None = None, **kwargs *args, type: str | list[str] | None = None, **kwargs
) -> SSHClient: # export ) -> SSHClient:
from importlib import import_module from importlib import import_module
errors: list[str] = [] errors: list[str] = []

View file

@ -33,20 +33,20 @@ async def _run(
if sudo else await run_cmd(cmd, ec = ec, cmd_input = InputMode.NonInteractive) if sudo else await run_cmd(cmd, ec = ec, cmd_input = InputMode.NonInteractive)
).stdout_str ).stdout_str
async def run_dpkg( async def run_dpkg( # export
args: list[str], args: list[str],
sudo: bool = False, sudo: bool = False,
ec: ExecContext | None = None ec: ExecContext | None = None
) -> str: # export ) -> str:
cmd = ['/usr/bin/dpkg'] cmd = ['/usr/bin/dpkg']
cmd.extend(args) cmd.extend(args)
return await _run(cmd, sudo, ec) return await _run(cmd, sudo, ec)
async def run_dpkg_query( async def run_dpkg_query( # export
args: list[str], args: list[str],
sudo: bool = False, sudo: bool = False,
ec: ExecContext | None = None ec: ExecContext | None = None
) -> str: # export ) -> str:
cmd = ['/usr/bin/dpkg-query'] cmd = ['/usr/bin/dpkg-query']
cmd.extend(args) cmd.extend(args)
return await _run(cmd, sudo, ec) return await _run(cmd, sudo, ec)

View file

@ -25,13 +25,13 @@ def meta_map():
) )
return _meta_map return _meta_map
async def run_rpm( async def run_rpm( # export
args: list[str], args: list[str],
sudo: bool = False, sudo: bool = False,
ec: ExecContext | None = None, ec: ExecContext | None = None,
mode: InputMode = InputMode.OptInteractive, mode: InputMode = InputMode.OptInteractive,
**kwargs, **kwargs,
) -> str: # export ) -> str:
cmd = ['/usr/bin/rpm'] cmd = ['/usr/bin/rpm']
cmd.extend(args) cmd.extend(args)
result = ( result = (
@ -40,10 +40,10 @@ async def run_rpm(
) )
return result.stdout_str return result.stdout_str
async def query_packages( async def query_packages( # export
names: Iterable[str] = [], names: Iterable[str] = [],
ec: ExecContext | None = None, ec: ExecContext | None = None,
) -> Iterable[Package]: # export ) -> Iterable[Package]:
fmt_str = ( fmt_str = (
'|'.join([(f'%{{{tag}}}' if tag else '') '|'.join([(f'%{{{tag}}}' if tag else '')
for tag in meta_map().values()]) + r'\n' for tag in meta_map().values()]) + r'\n'

View file

@ -209,12 +209,12 @@ async def copy(
return e return e
assert False, 'Unreachable code' assert False, 'Unreachable code'
async def get_username( async def get_username( # export
args: Namespace | None = None, args: Namespace | None = None,
url: str | None = None, url: str | None = None,
askpass_env: list[str] = [], askpass_env: list[str] = [],
ec: ExecContext | None = None, ec: ExecContext | None = None,
) -> str | None: # export ) -> str | None:
url_user = None if url is None else Uri(url).username url_user = None if url is None else Uri(url).username
if args is not None: if args is not None:
if args.username is not None: if args.username is not None:
@ -228,12 +228,12 @@ async def get_username(
return url_user return url_user
return await run_askpass(askpass_env, AskpassKey.Username, ec = ec) return await run_askpass(askpass_env, AskpassKey.Username, ec = ec)
async def get_password( async def get_password( # export
args: Namespace | None = None, args: Namespace | None = None,
url: str | None = None, url: str | None = None,
askpass_env: list[str] = [], askpass_env: list[str] = [],
ec: ExecContext | None = None, ec: ExecContext | None = None,
) -> str | None: # export ) -> str | None:
if args is None and url is None and not askpass_env: if args is None and url is None and not askpass_env:
raise Exception( raise Exception(
'Neither URL nor command-line arguments nor askpass environment variable ' 'Neither URL nor command-line arguments nor askpass environment variable '
@ -251,11 +251,11 @@ async def get_password(
return ret return ret
return await run_askpass(askpass_env, AskpassKey.Password, ec = ec) return await run_askpass(askpass_env, AskpassKey.Password, ec = ec)
async def get_profile_env( async def get_profile_env( # export
throw: bool = True, throw: bool = True,
keep: Iterable[str] | bool = False, keep: Iterable[str] | bool = False,
ec: ExecContext | None = None, ec: ExecContext | None = None,
) -> dict[str, str]: # export ) -> dict[str, str]:
""" """
Get a fresh environment from /etc/profile Get a fresh environment from /etc/profile