Actions

Each page is made up of a list of actions.

An action can be one of the inbuilt actions, a Page, or your own custom Action.

Inbuilt Actions

Terminal Command

This command allows you to execute a command in the terminal

menu.add([
    pyman.Actions.Cmd("Hello World", "echo 'Hello World'")
])
class pyman.Actions.Cmd(name, cmd='')[source]

Bases: pyman.Action.Action

Run a command in the terminal

cmd

The command to run

Back

This command will send you back one page in the menu

menu.add([
    pyman.Actions.Back()
])
class pyman.Actions.Back[source]

Bases: pyman.Action.Action

Go back one page

Exit

This command will exit out of the CLI

menu.add([
    pyman.Actions.Exit()
])
class pyman.Actions.Exit[source]

Bases: pyman.Action.Action

Exit the CLI

Action Class

class pyman.Action.Action(name)[source]

Base Action class to be used by all actions

name

The display name for this action

parent

The parent page this action is assigned to, value assigned when added to a Page

menu

The main page for this CLI instance, value assigned when added to a Page

init()[source]

This method is called when the Action is assigned to a Page

run()[source]

This method is called when the Action is executed. Overwrite it to perform your specific action