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 Noneon exception or before launch
-
launched¶ Returns: Trueif command was launched, otherwiseFalseA command is considered launched if any of the
exceptionor thereturncodeare not set toNone
-
success¶ Returns: Trueif command launch was successful, otherwiseFalseA command is considered successful if no
exceptionwas thrown and thereturncodeequalsCODE_SUCCESS
-
fields¶ Returns: Some information about the current command as dictionary Return type: dict Before the command was
launchedonlycmd,cwdandcinare included. Afterlaunchthe result is extended bystdout,stderr,excandcode.
-
__repr__()¶ String representation of current command. Utilizes
fields()andpprint.pformat()for that.
-
repr¶ Expand
__repr__()with triple-quotes andCHAR_NEWLINE.
-