pyre

Subpackages

Package Contents

pyre.resolve(uri)

Interpret {uri} as a request to locate and load a component

pyre.loadConfiguration(uri)

Open {uri} and attempt to load its contents into the configaration model

pyre.computeCallerStackDepth()

Compute the stack depth offset to get to the caller of a function

pyre.copyright()

Return the pyre copyright note

pyre.license()

Print the pyre license

pyre.version()

Return the pyre version

pyre.credits()

Print the acknowledgments

pyre.where(configurable, attribute=None)

Retrieve the location where the {attribute} of {configurable} got its value; if no {attribute} is specified, retrieve information about the {configurable} itself

pyre.boot()

Perform all the initialization steps necessary to bootstrap the framework

pyre.debug()

Enable debugging of pyre modules.

Modules that support debugging must provide a {debug} method and do as little as possible during their initialization. The fundamental constraints are provided by the python import algorithm that only give you one chance to import a module.

This must be done very early, before pyre itself starts importing its packages. One way to request debugging is to create a variable {pyre_debug} in the __main__ module that contains a set of strings, each one of which is the name of a pyre module that you would like to debug.

class pyre.actor(name, bases, attributes, *, family=None, **kwds)

Bases: pyre.components.Requirement.Requirement

The metaclass of components

{Actor} takes care of all the tasks necessary to convert a component declaration into a configurable entity that coöperates fully with the framework

__call__(self, name=None, locator=None, globalAliases=False, **kwds)

Build an instance of one of my classes

__setattr__(self, name, value)

Trap attribute setting in my class record instances to support setting the default value using the natural syntax

__str__(self)
class pyre.role(name, bases, attributes, *, family=None, **kwds)

Bases: pyre.components.Requirement.Requirement

The metaclass for protocols

__call__(self, **kwds)

The instantiation of protocol objects creates facility descriptors

__str__(self)
facility(self, **kwds)

Build my trait descriptor

class pyre.protocol

Bases: pyre.components.Configurable.Configurable

The base class for requirement specifications

pyre_key
pyre_isProtocol = True
EXTENSION = .py
class pyre.component(name, locator, **kwds)

Bases: pyre.components.Configurable.Configurable

The base class for all components

pyre_inventory
pyre_implements
pyre_isComponent = True
pyre_setTrait(self, alias, value, priority=None, locator=None)

Assign {value} to the trait named {alias}

pyre_getTrait(self, alias)

Retrieve the value and meta-data associated with the trait named {alias}

pyre_registered(self)

Hook that gets invoked by the framework after the component instance has been registered but before any configuration events

pyre_configured(self)

Hook that gets invoked by the framework after the component instance has been configured but before the binding of any of its traits

pyre_initialized(self)

Hook that gets invoked by the framework right before the component is put into action. The component is now in a known good state, with all configurable traits fully bound and validated. This is the place where the component should acquire whatever further resources it requires.

pyre_finalized(self)

Hook that gets invoked by the framework right before the component is decommissioned. The instance should release all acquired resources.

pyre_slot(self, attribute=None)

Return the slot associated with {attribute}; if no attribute s given, return the slot with the component instance itself

pyre_how(self, attribute)

Return the priority associated with {attribute}

pyre_where(self, attribute=None)

Return the locator associated with {attribute}; if no attribute name is given, return the locator of the component instance

__str__(self)
__getattr__(self, name)

Trap attribute lookup errors and attempt to resolve the name in my inventory’s name map. This makes it possible to get the value of a trait by using any of its aliases.

__setattr__(self, name, value)

Trap attribute assignment and attempt to normalize the name before making the assignment

class pyre.foundry(factory, implements=None, tip='', **kwds)

A decorator for callables that return component classes

pyre_tip =
pyre_factory
pyre_implements
__call__(self, *args, **kwds)
class pyre.monitor

Bases: pyre.calc.Probe.Probe

A probe that monitors the traits of a set of components

watch(self, component)

Monitor {component} for changes in the values of its traits

class pyre.tracker(**kwds)

Bases: pyre.components.Monitor.Monitor

A class that monitors the traits of a set of components and maintains a record of their values

track(self, component)

Add the {component} traits to the pile of observables

flush(self, observable, **kwds)

Handle the notification that the value of {observable} has changed

pyre.property
class pyre.export(method, tip=None, **kwds)

Bases: pyre.traits.Trait.Trait

The base class for component methods that are part of its external interface

method
category = behavior
isBehavior = True
__get__(self, instance, cls)

Access to the behavior

__set__(self, instance, value)

Disable writing to behavior descriptors

__str__(self)
class pyre.provides(method, tip=None, **kwds)

Bases: pyre.traits.Trait.Trait

The base class for component methods that are part of its external interface

method
category = behavior
isBehavior = True
__get__(self, instance, cls)

Access to the behavior

__set__(self, instance, value)

Disable writing to behavior descriptors

__str__(self)
class pyre.facility(protocol, **kwds)

Bases: pyre.traits.Slotted.Slotted, pyre.schemata.component

The descriptor for traits that are components

category = component
isFacility = True
macro(self, **kwds)

Return the default strategy for handling expressions in slot values

native(self, **kwds)

The strategy for building slots from more complex input values

instantiate(self, value, node, incognito=False, **kwds)

Coerce {value} into an instance of a component compatible with my protocol

__str__(self)
exception pyre.PyreError(description=None, locator=None, **kwds)

Bases: Exception

Base class for all pyre related errors

description = generic pyre error
__str__(self)
pyre.executive
pyre.package
pyre.shutdown()

Attempt to hunt down and destroy all known references to the executive