ATLAS Offline Software
Loading...
Searching...
No Matches
Herwig7Utils.Process Class Reference

Class for handling a single process. More...

Collaboration diagram for Herwig7Utils.Process:

Public Member Functions

 __init__ (self, ID, command, logfile_title)
 poll (self)

Public Attributes

 ID = ID
 logfile_title = logfile_title
 logfile = open(logfile_title, 'w')
 process = subprocess.Popen(command, stdout=self.logfile, stderr=self.logfile)

Detailed Description

Class for handling a single process.

This class provides the infrastructure to spawn a new subprocess from python, pipe the output to a logfile and check the status of the subprocess

Definition at line 92 of file Herwig7Utils.py.

Constructor & Destructor Documentation

◆ __init__()

Herwig7Utils.Process.__init__ ( self,
ID,
command,
logfile_title )

Definition at line 94 of file Herwig7Utils.py.

94 def __init__(self, ID, command, logfile_title):
95
96 athMsgLog.info(ansi_format_info("Starting subprocess #{} with command '{}' and logfile '{}'".format(ID, ' '.join(command), logfile_title)))
97 self.ID = ID
98 self.logfile_title = logfile_title
99 self.logfile = open(logfile_title, 'w')
100 self.process = subprocess.Popen(command, stdout=self.logfile, stderr=self.logfile)
101

Member Function Documentation

◆ poll()

Herwig7Utils.Process.poll ( self)

Definition at line 102 of file Herwig7Utils.py.

102 def poll(self):
103 return(self.process.poll())
104
105

Member Data Documentation

◆ ID

Herwig7Utils.Process.ID = ID

Definition at line 97 of file Herwig7Utils.py.

◆ logfile

Herwig7Utils.Process.logfile = open(logfile_title, 'w')

Definition at line 99 of file Herwig7Utils.py.

◆ logfile_title

Herwig7Utils.Process.logfile_title = logfile_title

Definition at line 98 of file Herwig7Utils.py.

◆ process

Herwig7Utils.Process.process = subprocess.Popen(command, stdout=self.logfile, stderr=self.logfile)

Definition at line 100 of file Herwig7Utils.py.


The documentation for this class was generated from the following file: