/opt/support/venv/lib/python3.13/site-packages/cproc/__pycache__
NameSizeModeActions
monitor.cpython-313.pyc65390644editdlrm
process.cpython-313.pyc101490644editdlrm
__init__.cpython-313.pyc4710644editdlrm
__main__.cpython-313.pyc23910644editdlrm
Edit: /opt/support/venv/lib/python3.13/site-packages/cproc/__pycache__/process.cpython-313.pyc (10149B)
i%SrSSKrSSKrSSKJr SSKJr SSKrSSK r SSK J r "SS5r "S S \R5rg) z&cproc module process execution objectsN) cpu_count)Callable) ProcMonitorc \rSrSrSrSrSSS\R \R4S\ \ -S-S\ \ \ 4S-S\ S-S\ \R-S \ S-S S4 S jjrS rg) ProcLimit aiContains load limits for cproc.Proc if used as the lim= arg Note: The grace argument could be useful for subprocesses which require a TCP session, such as rsync, to avoid a timeout caused by the process sleeping for too long. ex: ProcLimit(grace=(5, 1)) Args: value (int | float | None): maximum sever load. If set to None, it'll default to either the number of cores determined from multiprocessing.cpu_count(), or 1.0 if running on a VZ VPS grace (tuple[int, int] | None): If set, it should be a 2-item tuple of ints > 0. The first item is the number of seconds to sleep if the server is overloaded, and the second is how long to allow execution anyways once the sleep expires max_mem (int | None): If set, the process will be killed if it uses more than this amount of memory, in MiB mem_signal (Signal | int): kill signal to send the process if it goes over max_mem. Defaults to ``signal.SIGTERM`` mem_log_func (Callable | None): log function to call if a process is killed for being over memory. Defaults to ``logging.error`` cprocNvaluegracemax_mem mem_signal mem_log_funcreturncU(aUS-OSUlX@lXPlUc/[RR 5(aSO [ 5nXlX lg)Nig?) r rrradsvzis_vpsrr r )selfr r r rrs ?/opt/support/venv/lib/python3.13/site-packages/cproc/process.py__init__ProcLimit.__init__&sF+2wt $( =77>>++CE  )r r rrr )__name__ __module__ __qualname____firstlineno____doc__signalSIGTERMloggingerrorintfloattupleSignalsrr__static_attributes__rrrr s.J%)(,"+1>>(/ U{T!S#X%t  &..(  o  rrc^\rSrSrSrSr\R r\Rr\Rr\Rr \Rr \Rr SS.S\ \ -\-S-S\S \S-S \ S-S \ S-4 U4S jjjrSS \\-S-S\ \ -S-S\4Sjjr\SSSSSS.S\S \S-S \\-S-S\S\ \ -S-S\S\R4Sjj5rSrU=r$)Proc8aCustom subprocess.Popen subclass which allows automatic pausing and resuming based on server load and has no defaults for encoding, stdout, and stderr. Warning: Using None for stdout or stderr can be dangerous if your program runs as a daemon under systemd. Systemd can kill the subprocess with SIGPIPE. It's better to set the outputs to Proc.DEVNULL if you don't need them. Args: args: A string, or a sequence of program arguments lim (int, float, ProcLimit | None): max load limit. This can be a static limit if you set it to a float or int, or for more flexibility, use a ``ProcLimit`` instance shell (bool): If true, the command will be executed through the shell (unsafe) encoding (str | None): text encoding for subprocess output and input, such as "UTF-8". Set this to None to use no encoding (as bytes) stdout (int | None): specifies the executed program's standard output. Set to Proc.DEVNULL to not capture output. or Proc.PIPE to capture. Use None to print to your shell, but see Warning above stderr (int | None): specifies the executed program's error output. Set to Proc.DEVNULL to not capture output. or Proc.PIPE to capture. Use None to print to your shell, but see Warning above r F)shelllimNr,encodingstdoutstderrc >UcSUlO,[U[5(aX lO[U5Ul[TU]"U4UUUUS.UD6 URb[ U5Ulgg)N)r,r.r/r0)r- isinstancersuperrrmon) rargsr-r,r.r/r0kwargs __class__s rr Proc.__init__^sv ;DH Y ' 'H ~DH        88 "4(DH rinputtimeoutcheckcJURXS9upEU(a:UR(a)[R URUR XES9e[RUR URXE5$! UR5 UR5 e=f)anWait for a process to complete and return a CompletedProcess instance Args: input (bytes | str | None): text to send to stdin. stdin should have already been set to PIPE before sending anything to it timeout (int | float | None): raise Proc.TimeoutExpired if the process takes longer than this number of seconds to execute. Defaults to None check (bool): if True, raise Proc.CalledProcessError if the process exits with a non-zero exit code. The raised object will contain the .returncode attribute. Defaults to False Raises: Proc.CalledProcessError: program exited with a non-zero exit code and check=True was specified Proc.TimeoutExpired: program took too long to execute and timeout= was specified Returns: Proc.CompletedProcess: contains .args, .returncode, .stdout, and .stdin )r9r:)outputr0) communicatekillwait returncoder*CalledProcessErrorr5CompletedProcess)rr9r:r;r/r0s rcomplete Proc.complete|s: !--E-KNF T__))6* $$TYYPP  IIK IIK s A??#B")r,r9capture_outputr:r;rFrc Ub$SU;a [S5e[RUS'U(a8SU;dSU;a [S5e[Rn [Rn O#URS5n URS5n [U4UUU U US.UD6R XFUS 9$![an [S5U eSn A ff=f) aFRun command with arguments and return a CompletedProcess instance Args: args: A string, or a sequence of program arguments lim: max load limit. This can be a float, an int, an object with a .value property (such as a multiprocessing.Value or cproc.ProcLimit object), or an object with .__int__() defined to allow casting to an int shell (bool): If true, the command will be executed through the shell (unsafe) encoding (str | None): text encoding for subprocess output and input, such as "UTF-8". Set this to None to use no encoding (as bytes) input (bytes | str | None): text to send to stdin. Do not use the stdin= kwarg if you use input= capture_output (bool, optional): Sets stdout and stderr to Proc.PIPE if True. Do not also manually set stdout and stderr if this is set to True timeout (int | float | None): raise Proc.TimeoutExpired if the process takes longer than this number of seconds to execute. Defaults to None check (bool): if True, raise Proc.CalledProcessError if the process exits with a non-zero exit code. The raised object will contain the .returncode attribute. Defaults to False Raises: FileNotFoundError: requested program to execute does not exist Proc.CalledProcessError: program exited with a non-zero exit code and check=True was specified Proc.TimeoutExpired: program took too long to execute and timeout= was specified Returns: Proc.CompletedProcess: contains .args, .returncode, .stdout, and .stdin Nstdinz&stdin and input are mutually exclusiver/r0zEstdout and stderr cannot be manually specified if capture_output=Truez=stdout and stderr kwargs are required if capture_output=False)r-r,r/r0r.)r9r:r;) TypeErrorr*PIPEpopKeyErrorrD) r5r-r,r.r9rFr:r;r6 stdout_num stderr_numkey_excs rrunProc.runsb  &  HII"iiF7O 6!X%77JJ #ZZ1 #ZZ1       (u( = >  . s("B** C4 CC)r-r4)NNF)rrrrrsrJDEVNULLSTDOUTTimeoutExpiredrBrCr#r$rboolstrrbytesrD staticmethodrPr' __classcell__)r7s@rr*r*8s~4J 66DiiG XXF%%N--)) )5[9 $t + )  ) * )d )d ))@%)&* (Qs{T!(Qut#(Q (QT $($&*M> M> * M> s{T! M>M>ut#M>M>  M>M>rr*)rrr!multiprocessingrcollections.abcr subprocessrRrads.vzrmonitorrrPopenr*r(rrras:, %$ ))X|>177|>r