API Documentation

Let’s take a look at how ploogz works.

ploogz

Provide a brief description of the module.

ploogz.ploogins

Ploogins and Ploogin Loaders

class ploogz.ploogins.FsPlooginLoader

Bases: ploogz.ploogins.PlooginLoader

This is a ploogin loader that looks for ploogins in the local file system.

__init__

Initialize self. See help(type(self)) for accurate signature.

load(search_path: typing.List[str]) → typing.List[ploogz.ploogins.Ploogin]

Load the ploogins found in the search paths on the file system.

Parameters:search_path (List[str]) – the paths the loader will search when the load() method is called
class ploogz.ploogins.Ploogin(name: str)

Bases: object

Extend this class to create your own ploogins!

__init__(name: str)
Parameters:name (str) – a helpful, descriptive, human-readable name for the plugin
activate

An input for a L{MethodicalMachine}.

active = MethodicalState(method=<function Ploogin.active>)
initialized = MethodicalState(method=<function Ploogin.initialized>)
name

Get the helpful, descriptive, human-readable name for the ploogin.

Return type:str
ready = MethodicalState(method=<function Ploogin.ready>)
setup

An input for a L{MethodicalMachine}.

teardown

An input for a L{MethodicalMachine}.

torndown = MethodicalState(method=<function Ploogin.torndown>)
upon_activation()

Override this method to have the plugin do its principal work.

upon_setup()

Override this method to perform setup on the plugin. After this method is called, your plugin should be ready for the activate() method to be called so it can start doing its thing.

Seealso:Ploogin.activate()
upon_teardown()

Override this method perform steps required when the application using the plugin decides that its work is done.

class ploogz.ploogins.PlooginHost(search_path: typing.List[str] = None, loader: ploogz.ploogins.PlooginLoader = None)

Bases: object

Use a host object to load and retrieve your ploogins.

__init__(search_path: typing.List[str] = None, loader: ploogz.ploogins.PlooginLoader = None)
Parameters:search_path (List[str] or str) – the paths the plugin host will search when the load() method is called
Seealso:PlooginHost.load()

Note

If no search path is provided, the default path is builtin/ploogins under the current working directory.

initialized = MethodicalState(method=<function PlooginHost.initialized>)
load

An input for a L{MethodicalMachine}.

loaded = MethodicalState(method=<function PlooginHost.loaded>)
ploogins

Get the ploogins loaded by this host.

Return type:Iterator[Ploogin]
teardown

An input for a L{MethodicalMachine}.

torndown = MethodicalState(method=<function PlooginHost.torndown>)
class ploogz.ploogins.PlooginLoader

Bases: object

Extend this class to create a ploogin loader that can look through search paths to find and instantiate ploogins.

__init__

Initialize self. See help(type(self)) for accurate signature.

load(search_path: typing.List[str]) → typing.List[ploogz.ploogins.Ploogin]

Override this method to implement the loader’s primary loading logic.

Parameters:search_path (List[str]) – the paths the plugin host will search when the load() method is called