mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 17:45:55 +02:00
lib.ExecContext,Local: Remove callback default params
Remove defaults from protected callback function parameters. They have to be decided by the base class's public API. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
c6e8d38497
commit
1325222fbd
2 changed files with 28 additions and 15 deletions
|
|
@ -14,14 +14,14 @@ class Local(Base):
|
|||
async def _run(
|
||||
self,
|
||||
args: list[str],
|
||||
wd: str|None = None,
|
||||
throw: bool = True,
|
||||
verbose: bool = False,
|
||||
cmd_input: str|None = None,
|
||||
env: dict[str, str]|None = None,
|
||||
title: str=None,
|
||||
output_encoding: str|None = None, # None => unchanged; "bytes" => return raw bytes
|
||||
) -> tuple[str|bytes|None, str|bytes|None]:
|
||||
wd: str|None,
|
||||
throw: bool,
|
||||
verbose: bool,
|
||||
cmd_input: str|None,
|
||||
env: dict[str, str]|None,
|
||||
title: str,
|
||||
output_encoding: str|None, # None => unchanged; "bytes" => return raw bytes
|
||||
) -> Result:
|
||||
|
||||
want_bytes = (output_encoding == "bytes")
|
||||
|
||||
|
|
@ -197,7 +197,7 @@ class Local(Base):
|
|||
if verbose and not interactive:
|
||||
log(NOTICE, '`' + delim + ' <')
|
||||
|
||||
async def _sudo(self, cmd: list[str], mod_env: dict[str, str] = {}, opts: list[str]=[], verbose=True) -> Result:
|
||||
async def _sudo(self, cmd: list[str], mod_env: dict[str, str], opts: list[str], verbose: bool) -> Result:
|
||||
env: dict[str, str]|None = None
|
||||
cmd_input: str|None = None
|
||||
if mod_env:
|
||||
|
|
@ -212,4 +212,6 @@ class Local(Base):
|
|||
cmdline.extend(cmd)
|
||||
if self.interactive:
|
||||
cmd_input = "mode:interactive"
|
||||
return await self._run(cmdline, throw=True, verbose=verbose, env=env, cmd_input=cmd_input)
|
||||
# Need to call the base class function, because _run() needs more
|
||||
# parameters than we have values for
|
||||
return await self.run(cmdline, throw=True, verbose=verbose, env=env, cmd_input=cmd_input)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue