ps/str,...
This commit is contained in:
parent
521884102e
commit
cd4e7403ae
1 changed files with 4 additions and 4 deletions
|
@ -5,7 +5,7 @@ import subprocess
|
||||||
from rwx import txt
|
from rwx import txt
|
||||||
|
|
||||||
|
|
||||||
def get_tuples_args(*items: str | tuple[str]) -> list[str]:
|
def get_tuples_args(*items: str | tuple[str, ...]) -> list[str]:
|
||||||
"""Turn arguments tuples into an arguments list."""
|
"""Turn arguments tuples into an arguments list."""
|
||||||
args: list[str] = []
|
args: list[str] = []
|
||||||
for item in items:
|
for item in items:
|
||||||
|
@ -16,21 +16,21 @@ def get_tuples_args(*items: str | tuple[str]) -> list[str]:
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
def run(*items: str | tuple[str]) -> subprocess.CompletedProcess:
|
def run(*items: str | tuple[str, ...]) -> subprocess.CompletedProcess:
|
||||||
"""Run from a list of arguments tuples."""
|
"""Run from a list of arguments tuples."""
|
||||||
return subprocess.run(
|
return subprocess.run(
|
||||||
get_tuples_args(*items), capture_output=False, check=True
|
get_tuples_args(*items), capture_output=False, check=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def run_line(*items: str | tuple[str], charset: str = txt.CHARSET) -> str:
|
def run_line(*items: str | tuple[str, ...], charset: str = txt.CHARSET) -> str:
|
||||||
"""Run and return output line."""
|
"""Run and return output line."""
|
||||||
line, *_ = run_lines(*items, charset=charset)
|
line, *_ = run_lines(*items, charset=charset)
|
||||||
return line
|
return line
|
||||||
|
|
||||||
|
|
||||||
def run_lines(
|
def run_lines(
|
||||||
*items: str | tuple[str], charset: str = txt.CHARSET
|
*items: str | tuple[str, ...], charset: str = txt.CHARSET
|
||||||
) -> list[str]:
|
) -> list[str]:
|
||||||
"""Run and return output lines."""
|
"""Run and return output lines."""
|
||||||
process = subprocess.run(
|
process = subprocess.run(
|
||||||
|
|
Loading…
Reference in a new issue