squishy.applets.SquishyApplet

Todo

Flesh this out

class squishy.applets.SquishyApplet

Squishy applet base class.

This is the abstract base class that is used to implement any possible applet for squishy.

It represents a combination of client-side python, and gateware that will run the the hardware platform.

Users can then invoke the build and execution of implemented applets by name.

Variables
  • preview (bool) – If the applet is a preview/pre-release applet.

  • pretty_name (str) – A pretty string name of the applet.

  • short_help (str) – A short section of help for the applet.

  • help (str) – A longer more detailed help string.

  • description (str) – A brief description about the applet.

  • hardware_rev (str, tuple) – A single string, or a tuple of strings for supported hardware revisions

  • supports_gui (bool) – Indicates if the applet has a GUI mode.

  • supports_repl (bool) – Indicates if the applet has a REPL mode.

supported_platform(platform: str) bool

Check to see if the given platform is supported

Parameters

platform (str) – The platform to check

Returns

True if the applet supports the platform, otherwise False.

Return type

bool

show_help() None

Shows applets built-in help

init_gui(main_window, args) bool

Initializes applet GUI component

Parameters
  • main_window (squishy.gui.MainWindow) – The main GUI window.

  • args (argsparse.Namespace) – Any command line arguments passed.

init_repl(repl_ctx, args) bool

Initializes applet REPL component

Parameters
  • repl_ctx (None) – The REPL context

  • args (argsparse.Namespace) – Any command line arguments passed.

abstract init_applet(args) AppletElaboratable

Applet Initialization

Called to initialize the applet prior to the applet being built and ran

Parameters

args (argsparse.Namespace) – Any command line arguments passed.

Returns

The applet logic/elaboratable

Return type

AppletElaboratable

Raises

NotImplementedError – The abstract method must be implemented by the applet

abstract register_args(parser) None

Applet argument registration

Called to register any applet specific arguments.

Parameters

parser (argparse.ArgumentParser) – The root argparse parser.

Raises

NotImplementedError – The abstract method must be implemented by the applet

abstract run(device, args) int

Applet run step

Called to run any specialized machinery for the applet.

Parameters
Returns

0 if run was successful, otherwise an error code.

Return type

int

Raises

NotImplementedError – The abstract method must be implemented by the applet