bout_runners.submitter.local_submitter

Contains the local submitter class.

Classes

LocalSubmitter(path, processor_split)

Submits a command.

class bout_runners.submitter.local_submitter.LocalSubmitter(path: Optional[pathlib.Path] = None, processor_split: None = None)[source]

Submits a command.

Examples

>>> LocalSubmitter().submit_command('ls')
CompletedProcess(args=['ls'], returncode=0, stdout=b'__init__.py\n
__pycache__\n
test_local_submitter.py\n
test_processor_split.py\n
test_submitter_factory.py\n', stderr=b'')
Attributes
__pidNone or int

Getter variable for pid

pathPath or str

Directory to run the command from

processor_splitProcessorSplit

Object containing the processor split

pidNone or int

Return the process id.

Methods

submit_command(command)

Run a subprocess

_raise_submit_error(self, result):

Raise and error from the subprocess in a clean way.

Set the path from where the calls are made from.

Parameters
pathPath or str or None

Directory to run the command from If None, the calling directory will be used

processor_splitProcessorSplit or None

Object containing the processor split If None, default values will be used

Attributes
pid

Return the process id.

Methods

submit_command(self, command)

Run a subprocess.

property pid

Return the process id.

Returns
self.__pidint or None

The process id if a process has been called, else None

submit_command(self, command: str) → subprocess.CompletedProcess[source]

Run a subprocess.

Parameters
commandstr

The command to run

Returns
resultsubprocess.CompletedProcess

The result of the subprocess call