trading_agent.client.app_commands
¶
The trading-agent apps commands: list the packages' apps, and enable or disable their systemd units.
Enabling links the unit file the app's app.toml names (when systemd does not know the unit yet), then enables and starts it, so the app starts at every login. This is a command rather than a web page button, because it adds a program to the machine's start-up.
Typical usage example:
exit_code = asyncio.run(AppCommands(catalog).enable('sridhara'))
AppCommands
¶
Lists and sets up the packages' apps for the user.
Creates the commands.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
catalog
|
AppCatalog
|
The packages' apps. |
required |
output
|
TextIO
|
Where to print. |
stdout
|
Source code in src/trading_agent/client/app_commands.py
list
async
¶
Prints each app with its address, whether it answers and its unit's state.
Returns:
| Type | Description |
|---|---|
int
|
0 when every app.toml is readable, 1 otherwise. |
Source code in src/trading_agent/client/app_commands.py
enable
async
¶
Links, enables and starts an app's unit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package
|
str
|
The package. |
required |
Returns:
| Type | Description |
|---|---|
int
|
0 when the unit is running, 1 otherwise. |
Source code in src/trading_agent/client/app_commands.py
disable
async
¶
Stops an app's unit and stops it starting at login.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package
|
str
|
The package. |
required |
Returns:
| Type | Description |
|---|---|
int
|
0 when done, 1 otherwise. |