ape.infrastructure.ryemother.RyeMother

class ape.infrastructure.ryemother.RyeMother(exclusions=['index.py', '__init__.py'], parent=None, base_package=None, group=None, name=None, module=None, keyfunction=None)

A gatherer of child classes

Rye Mother constructor

Param:
  • exclusions: list of filenames to ignore
  • parent: class definiton for parent of classes to import
  • base_package: the top-level package (e.g. ‘ape’)
  • group: group-name from the setup.py entry_points
  • name: name of entry in group
  • module: name of module (to use instead of an entry point)
  • keyfunction: a function to transform the dictionary keys
__init__(exclusions=['index.py', '__init__.py'], parent=None, base_package=None, group=None, name=None, module=None, keyfunction=None)

Rye Mother constructor

Param:
  • exclusions: list of filenames to ignore
  • parent: class definiton for parent of classes to import
  • base_package: the top-level package (e.g. ‘ape’)
  • group: group-name from the setup.py entry_points
  • name: name of entry in group
  • module: name of module (to use instead of an entry point)
  • keyfunction: a function to transform the dictionary keys

Methods

__init__([exclusions, parent, base_package, ...]) Rye Mother constructor
from_entry_point(parent, group, name, ...) Retrieves the definitions using an entry-point
from_module_name(parent, modulename, keyfunction) Retrieves the definitions using the modulename (dot-notation: ape.plugins)

Attributes

base_package The name of the top-level package
from_entry_point(parent, group, name, keyfunction)

Retrieves the definitions using an entry-point

Param:
  • parent: parent class whose children to gather
  • group: [<group.name>] entry from setup.py entry_points
  • name: name given in the entry_point
  • keyfunction: function to transform the keys of the dict
Returns:

dict of name:class definition

from_module_name(parent, modulename, keyfunction)

Retrieves the definitions using the modulename (dot-notation: ape.plugins)

Param:
  • parent: parent class whose children to gather
  • modulename: name of a module (if this is given, group and name will be ignored)
  • keyfunction: function to transform the keys of the dict
Returns:

dict of name:class definition

base_package

The name of the top-level package

Navigation