Shell Commands#

ignis.utils.Utils.exec_sh(command: str, **kwargs) CompletedProcess#

Execute a shell (bash) command.

Parameters:

command (str) -- The command to execute.

**kwargs will be passed to subprocess.run().

Return type:

CompletedProcess

Returns:

The result of the command execution. You can use the stdout property to get the command's output.

async ignis.utils.Utils.exec_sh_async(command: str) AsyncCompletedProcess#

Execute a shell (bash) command asynchronously.

Parameters:
  • command (str) -- The command to execute.

  • on_finished -- A function to call when the process is finished. An instance of AsyncCompletedProcess will be passed to this function.

Return type:

AsyncCompletedProcess

Returns:

The instance of Gio.Subprocess.

class ignis.utils.Utils.AsyncCompletedProcess(stdout: str, stderr: str, returncode: int) None#

Completed process object for exec_sh_async().

property returncode: int#

The return code of the process.

property stdout: str#

The output of the process.

property stderr: str#

The stderr (errors) of the process.