Registry

class glue.config.Registry[source]

Bases: object

Container to hold groups of objects or settings.

Registry instances are used by Glue to track objects used for various tasks like data linking, widget creation, etc. They have the following properties:

  • A members property, which lists each item in the registry
  • A default_members function, which can be overridden to lazily initialize the members list
  • A call interface, allowing the instance to be used as a decorator for users to add new items to the registry in their config files

Attributes Summary

members A list of the members in the registry.

Methods Summary

__call__(arg) This is provided so that registry instances can be used as decorators.
add(value) Add a new item to the registry.
default_members() The member items provided by default.
lazy_add(value) Add a reference to a plugin which will be loaded when needed.

Attributes Documentation

members[source]

A list of the members in the registry. The return value is a list. The contents of the list are specified in each subclass

Methods Documentation

__call__(arg)[source]

This is provided so that registry instances can be used as decorators. The decorators should add the decorated code object to the registry, and return the original function

add(value)[source]

Add a new item to the registry.

default_members()[source]

The member items provided by default. These are put in this method so that code is only imported when needed

lazy_add(value)[source]

Add a reference to a plugin which will be loaded when needed.