Placet documentation
Placetpy(name='placet', **kwargs)
Bases: Communicator
A class used to interact with Placet process running in background.
Extends Communicator to run Placet
and its commands of the proper format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
str
|
The name of the process to start. Should be the command starting Placet interactive shell. |
'placet'
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
show_intro |
bool
|
If |
debug_mode |
bool
|
If |
save_logs |
bool
|
If |
send_delay |
float
|
The time delay before each data transfer to a child process (sometimes needed for stability).
Default is |
readline(timeout=Communicator._BASE_TIMEOUT)
Read the line from Placet process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout |
float
|
Timeout of the reader before raising the exception. No effect anymore. The parameter is kept for compatibility. |
Communicator._BASE_TIMEOUT
|
Returns:
| Type | Description |
|---|---|
str
|
The line of the data received from the child process. |
restart()
Restart the child process.
run_command(command, skipline=True)
Run the given command in Placet.
Does not return any value.
The output after the execution is up to the user to read with readline()
or readlines().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command |
PlacetCommand
|
The command to pass to Placet. |
required |
skipline |
bool
|
If |
True
|
PlacetCommand(command, **kwargs)
A class used to classify the Placet commands.
Attributes:
| Name | Type | Description |
|---|---|---|
command |
str
|
A line with Placet command, including all the options |
timeout |
float
|
The typical time margin for the execution time of the command.
Is passed further to |
type |
str
|
The type of the command. Corresponds to the command name, without any options |
additional_lineskip |
int
|
The number of lines that the command produces when executed. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command |
str
|
The command including all the options as a string. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
timeout |
Optional[float]
|
A timeout for the command execution in Placet. |
type |
str
|
A command type. Correspons to the command name without any parameters. If not provided, is evaluated automatically. |
additional_lineskip |
int
|
The number of lines of the Placet output to skip after writing the command. If not provided, is evaluated automatically based on the type of a command. |
expect_before |
bool
|
If |
expect_after |
bool
|
If |
no_expect |
bool
|
If |