ways.base.plugin module

A module that holds Plugin classes and objects that combine into a Context.

class ways.base.plugin.DataPlugin(name, sources, info, assignment)[source]

Bases: ways.base.plugin.Plugin

An add-on that was made from a serialized file (JSON/YAML/etc).

This class behaves exactly like a regular Plugin object and is stored in the same space as Plugin objects.

DataPlugin does not add itself to the cache automatically. It is the responsibility of some other class/function to register it to Ways.

We do this so that we can have better control over the DataPlugin’s args and its assignment before it hits the cache.

add_to_registry = False
get_assignment()[source]

str: Where this Plugin lives in Ways, along with its hierarchy.

get_groups()[source]

Get the groups that this Plugin evaluates onto.

Note

The term ‘groups’ is not the same as the assignment of a Plugin. They are two different things.

Returns:The groups.
Return type:tuple[str]
get_hierarchy()[source]

tuple[str] or str: The location that this Plugin exists within.

get_mapping()[source]

str: The physical location of this Plugin (on the filesystem).

get_mapping_details()[source]

dict[str]: Information about the mapping, if needed.

get_max_folder()[source]

str: The furthest location up that this plugin can navigate to.

get_platforms()[source]

set[str]: The platforms that this Plugin is allowed to run on.

get_uses()[source]

tuple[str]: The Context hierarchies this instance depends on.

get_uuid()[source]

str: A unique ID for this plugin.

is_path()[source]

If the mapping is a filepath or None if unsure.

Returns:If the mapping is a path to a file/folder on disk.
Return type:bool or NoneType
class ways.base.plugin.Plugin[source]

Bases: object

An add-on that is later retrieved by Context to gather its data.

add_to_registry = True
data

**dict[str]* – The display properties (like {‘color’* – ‘red’}).

class ways.base.plugin.PluginRegistry[source]

Bases: type

A metaclass that adds new Plugin objects to a cache.

ways.base.plugin.get_assignment(obj)[source]

str: Get an object’s assignment or fallback to ways.DEFAULT_ASSIGNMENT.