Proc Module¶
This module handles communication with the operating system. Namely launching commands.
-
git_sh_sync.proc.
CODE_SUCCESS
= 0¶ Returncode of a successful command
-
git_sh_sync.proc.
CHAR_NEWLINE
= '\n'¶ Newline character used for detailed log output
-
class
git_sh_sync.proc.
Command
(cmd, *, cwd=None, cin=None)¶ This is a class-based command runner using
subprocess
-
__init__
(cmd, *, cwd=None, cin=None)¶ Initialize a new command
Parameters: - cmd – Commandline of command to launch
- cwd – Launch cmd inside some other current working directory
- cin – Send data via stdin into cmd
-
cwd
¶ Returns: Current working directory or None
-
cin
¶ Returns: Stdin data or None
-
exc
¶ Returns: If launching the command raised some exception it is available here, otherwise None
-
code
¶ Returns: The shell returncode after launching. Will be None
on exception or before launch
-
launched
¶ Returns: True
if command was launched, otherwiseFalse
A command is considered launched if any of the
exception
or thereturncode
are not set toNone
-
success
¶ Returns: True
if command launch was successful, otherwiseFalse
A command is considered successful if no
exception
was thrown and thereturncode
equalsCODE_SUCCESS
-
fields
¶ Returns: Some information about the current command as dictionary Return type: dict Before the command was
launched
onlycmd
,cwd
andcin
are included. Afterlaunch
the result is extended bystdout
,stderr
,exc
andcode
.
-
__repr__
()¶ String representation of current command. Utilizes
fields()
andpprint.pformat()
for that.
-
repr
¶ Expand
__repr__()
with triple-quotes andCHAR_NEWLINE
.
-