Lines Matching full:process
84 # Process stock_list.
312 def match_process_by_pgm_name(process, pgm_name): argument
314 Return True or False to indicate whether the process matches the program name.
317 … process A psutil process object such as the one returned by psutil.Process().
318 … pgm_name The name of a program to look for in the cmdline field of the process
322 … # This function will examine elements 0 and 1 of the cmdline field of the process object. The
325 # Example 1: Suppose a process was started like this:
331 # match_process_by_pgm_name(process, "python_pgm_template")
333 # The process object might contain the following for its cmdline field:
344 # Example 2: Suppose a process was started like this:
350 # match_process_by_pgm_name(process, "sleep")
352 # The process object might contain the following for its cmdline field:
361 cmdline = process.as_dict()["cmdline"]
368 Select the processes that match pgm_name and return the result as a list of process objects.
371 processes A list of psutil process objects such as the one returned by
372 psutil.Process().
373 … pgm_name The name of a program to look for in the cmdline field of each process
378 process
379 for process in processes
380 if match_process_by_pgm_name(process, pgm_name)
385 Create a process report for the given pids and return it as a string.
388 … pids A list of process IDs for processes to be included in the report.
401 def get_descendant_info(process=psutil.Process()): argument
403 Get info about the descendants of the given process and return as a tuple of descendants,
406 …descendants will be a list of process objects. descendant_pids will be a list of pids (in str for…
410 … process A psutil process object such as the one returned by psutil.Process().
412 descendants = process.children(recursive=True)
413 descendant_pids = [str(process.pid) for process in descendants]
416 [str(process.pid)] + descendant_pids
424 … Terminate descendants of the current process according to the requirements layed out in global
430 …stdout stream being used by this process. If this function writes directly to stdout, its output …
432 …interpret the output. In order solve this problem, the activity of this process will be logged to…
439 … Note that a general principal being observed here is that each process is responsible for the
447 current_process = psutil.Process()
465 # Process the termination requests:
468 term_pids = [str(process.pid) for process in term_processes]
473 # Process term requests by pgm_names.
479 term_pids = [str(process.pid) for process in term_processes]
484 for process in term_processes:
485 process.terminate()
492 … Checking after the fact to see whether any descendant processes are still alive. If so, a process