i3pyblocks._internal.subprocess

Module Contents

Functions

arun(args: i3pyblocks._internal.models.CommandArgs, *, stdin: Optional[int] = DEVNULL, input: Optional[AnyStr] = None, stdout: Optional[int] = DEVNULL, stderr: Optional[int] = DEVNULL, capture_output: bool = False, shell: Optional[bool] = None, text: bool = False, **other_subprocess_kwargs) → subprocess.CompletedProcess

Wrapper around asyncio.subprocess with an API similar to subprocess.run().

popener(args: i3pyblocks._internal.models.CommandArgs, *, stdin: Optional[int] = DEVNULL, stdout: Optional[int] = DEVNULL, stderr: Optional[int] = DEVNULL, shell: Optional[bool] = None, text: bool = False) → subprocess.Popen

Wrapper around subprocess.Popen, executing a child program in a new process.

async i3pyblocks._internal.subprocess.arun(args: i3pyblocks._internal.models.CommandArgs, *, stdin: Optional[int] = DEVNULL, input: Optional[AnyStr] = None, stdout: Optional[int] = DEVNULL, stderr: Optional[int] = DEVNULL, capture_output: bool = False, shell: Optional[bool] = None, text: bool = False, **other_subprocess_kwargs) subprocess.CompletedProcess

Wrapper around asyncio.subprocess with an API similar to subprocess.run().

This is not complete and there is some deliberately differences:

  • Auto-detection of shell parameter based on arguments

  • By default, stdin/stdout/stderr point to /dev/null, so the process is isolated from outside

It should offer a better experience than the default asyncio.subprocess API, so this is preferred than using asyncio.subprocess primitives. Can be expanded if/when needed.

i3pyblocks._internal.subprocess.popener(args: i3pyblocks._internal.models.CommandArgs, *, stdin: Optional[int] = DEVNULL, stdout: Optional[int] = DEVNULL, stderr: Optional[int] = DEVNULL, shell: Optional[bool] = None, text: bool = False) subprocess.Popen

Wrapper around subprocess.Popen, executing a child program in a new process.

This is not complete and there is some deliberately differences:

  • Auto-detection of shell parameter based on arguments

  • By default, stdin/stdout/stderr point to /dev/null, so the process is isolated from outside

Recommended for those cases where arun() does not cover, i.e.: need to run a program completely in background and the result of its execution does not matter.