Skip to main content
. 2023 Jan 9;23(2):733. doi: 10.3390/s23020733
Algorithm 2. Part of the “run” function within the abstract ToolExecutor class.
self.logger.debug(f’Running command: <{command}>’)
if self.verbose:
    self.logger.debug(f’\tkeywords: <{proc_flags}>’)
 
try:
    output = subprocess.run(command, **proc_flags)
except subprocess.TimeoutExpired as e:
    self.logger.debug(f’Process timout’)
    return True
else:
    if self.verbose:
        self.logger.debug(f’Captured stdout: <{output.stdout[:-1]}>’)
        self.logger.debug(f’Captured stderr: <{output.stderr}>’)
    return output