setup

After initial setup, configure autopilot: create an autopilot directory and a prefs.json file

Classes:

Autopilot_Form(*args, **kwargs)

Base class for Autopilot setup forms

Hardware_Form(*args, **kwargs)

Agent_Form([name, parentApp, framed, help, …])

Directory_Form(*args, **kwargs)

Common_Form(*args, **kwargs)

Scripts_Form(*args, **kwargs)

Pilot_Config_Form_1(*args, **kwargs)

Terminal_Form(*args, **kwargs)

Autopilot_Setup(prefs)

Functions:

unfold_values(v)

Unfold nested values from the SetupForm.

make_dir(adir[, permissions])

Make a directory if it doesn’t exist and set its permissions to 0777

make_alias(launch_script[, bash_profile])

Make an alias so that calling autopilot calls autopilot_dir/launch_autopilot.sh

class Autopilot_Form(*args, **kwargs)[source]

Bases: npyscreen.fmForm.Form

Base class for Autopilot setup forms

Each subclass needs to override the create() method to add the graphical elements for the form, typically by using populate_form() with a standardized description from autopilot.prefs , and the NAME attribute. The DESCRIPTION attribute provides title text for the form

Attributes:

NAME

DESCRIPTION

Methods:

populate_dependencies(params)

populate_form(params)

update_depends(param_name)

afterEditing()

NAME = ''
DESCRIPTION = ''
populate_dependencies(params)[source]
populate_form(params)[source]
update_depends(param_name)[source]
afterEditing()[source]
class Hardware_Form(*args, **kwargs)[source]

Bases: npyscreen.fmFormWithMenus.FormWithMenus, autopilot.setup.setup_autopilot.Autopilot_Form

Attributes:

NAME

DESCRIPTION

Methods:

create()

Programmers should over-ride this in derived classes, creating widgets here

list_hardware()

add_hardware(module, class_name)

NAME = 'HARDWARE'
DESCRIPTION = 'Configure Hardware Objects'
create()[source]

Programmers should over-ride this in derived classes, creating widgets here

list_hardware()[source]
add_hardware(module, class_name)[source]
class Agent_Form(name=None, parentApp=None, framed=None, help=None, color='FORMDEFAULT', widget_list=None, cycle_widgets=False, *args, **keywords)[source]

Bases: npyscreen.fmForm.Form

Attributes:

NAME

DESCRIPTION

Methods:

create()

Programmers should over-ride this in derived classes, creating widgets here

afterEditing()

NAME = 'AGENT'
DESCRIPTION = 'Select an Agent'
create()[source]

Programmers should over-ride this in derived classes, creating widgets here

afterEditing()[source]
class Directory_Form(*args, **kwargs)[source]

Bases: autopilot.setup.setup_autopilot.Autopilot_Form

Attributes:

NAME

DESCRIPTION

Methods:

create()

Programmers should over-ride this in derived classes, creating widgets here

NAME = 'DIRECTORIES'
DESCRIPTION = 'Configure directory structure'
create()[source]

Programmers should over-ride this in derived classes, creating widgets here

class Common_Form(*args, **kwargs)[source]

Bases: autopilot.setup.setup_autopilot.Autopilot_Form

Attributes:

NAME

DESCRIPTION

Methods:

create()

Programmers should over-ride this in derived classes, creating widgets here

NAME = 'COMMON'
DESCRIPTION = 'Configure common prefs'
create()[source]

Programmers should over-ride this in derived classes, creating widgets here

class Scripts_Form(*args, **kwargs)[source]

Bases: autopilot.setup.setup_autopilot.Autopilot_Form

Attributes:

NAME

DESCRIPTION

Methods:

create()

Programmers should over-ride this in derived classes, creating widgets here

NAME = 'SCRIPTS'
DESCRIPTION = 'Choose environment configuration scripts to run'
create()[source]

Programmers should over-ride this in derived classes, creating widgets here

class Pilot_Config_Form_1(*args, **kwargs)[source]

Bases: autopilot.setup.setup_autopilot.Autopilot_Form

Attributes:

NAME

DESCRIPTION

Methods:

create()

Programmers should over-ride this in derived classes, creating widgets here

NAME = 'PILOT'
DESCRIPTION = 'Configure Pilot-specific prefs'
create()[source]

Programmers should over-ride this in derived classes, creating widgets here

class Terminal_Form(*args, **kwargs)[source]

Bases: autopilot.setup.setup_autopilot.Autopilot_Form

Attributes:

NAME

DESCRIPTION

Methods:

create()

Programmers should over-ride this in derived classes, creating widgets here

NAME = 'TERMINAL'
DESCRIPTION = 'Configure Terminal-specific prefs'
create()[source]

Programmers should over-ride this in derived classes, creating widgets here

class Autopilot_Setup(prefs)[source]

Bases: npyscreen.apNPSApplicationManaged.NPSAppManaged

Attributes:

PATHS

Allow different agents to have different paths through setup

active_scripts

Get dict of active scripts

Methods:

onStart()

Add forms by gathering subclasses of Autopilot_Form

next_form_in_path(calling_form)

unpack_prefs()

Unpack the prefs from the forms and return them complete

PATHS = {   'PILOT': ['AGENT', 'DIRECTORIES', 'COMMON', 'PILOT', 'HARDWARE', 'SCRIPTS'],     'TERMINAL': ['AGENT', 'DIRECTORIES', 'COMMON', 'TERMINAL', 'SCRIPTS']}

Allow different agents to have different paths through setup

onStart()[source]

Add forms by gathering subclasses of Autopilot_Form

next_form_in_path(calling_form: autopilot.setup.setup_autopilot.Autopilot_Form)[source]
unpack_prefs()[source]

Unpack the prefs from the forms and return them complete

Returns

dict - your prefs!

property active_scripts

Get dict of active scripts

Returns

script_commands

Return type

dict - script_name

unfold_values(v)[source]

Unfold nested values from the SetupForm. Called recursively.

Parameters

v (dict) – unfolded values

make_dir(adir, permissions: int = 511)[source]

Make a directory if it doesn’t exist and set its permissions to 0777

Parameters
  • adir (str) – Path to the directory

  • permissions (int) – an octal integer used to set directory permissions (default 0o777)

make_alias(launch_script: str, bash_profile: Optional[str] = None)[source]

Make an alias so that calling autopilot calls autopilot_dir/launch_autopilot.sh

Parameters
  • launch_script (str) – the path to the autopilot launch script to be aliased

  • bash_profile (str, None) – Optional, location of shell profile to edit. if None, use .bashrc then .bash_profile if they exist