Module v.c.a.dependency

Part of vmc.contrib.axiom

A dependency management system for items.
Function dependentsOf Undocumented
Function dependsOn This function behaves like axiom.attributes.reference but with
Function classDependsOn Undocumented
Function installOn Install this object on the target, tracking that the object now
Function uninstallFrom Remove this object from the target, as well as any dependencies
Function installedOn If this item is installed on another item, return the install
Function installedDependents Return an iterable of things installed on the target that
Function installedUniqueRequirements Return an iterable of things installed on the target that this item
Function installedRequirements Return an iterable of things installed on the target that this
Function onlyInstallPowerups Only power up the target with this object's powerups, without interacting
def dependentsOf(cls):
Undocumented
def dependsOn(itemType, itemCustomizer=None, doc='', indexed=True, whenDeleted=reference.NULLIFY):

This function behaves like axiom.attributes.reference but with an extra behaviour: when this item is installed (via axiom.dependency.installOn on a target item, the type named here will be instantiated and installed on the target as well.

For example:
 class Foo(Item):
     counter = integer()
     thingIDependOn = dependsOn(Baz, lambda baz: baz.setup())
ParametersitemTypeThe Item class to instantiate and install.
itemCustomizerA callable that accepts the item installed as a dependency as its first argument. It will be called only if an item is created to satisfy this dependency.
ReturnsAn axiom.attributes.reference instance.
def _dependsOn_advice(cls):
Undocumented
def classDependsOn(cls, itemType, itemCustomizer, ref):
Undocumented
def installOn(self, target):

Install this object on the target, tracking that the object now depends on the target, and the object was explicitly installed and therefore should not be uninstalled by subsequent uninstallation operations unless it is explicitly removed.

If the type of the object being installed has a "powerupInterfaces" attribute (containing either a sequence of interfaces, or a sequence of (interface, priority) tuples), the target will be powered up with this object on those interfaces.

If this object has a "__getPowerupInterfaces__" method, it will be called with an iterable of (interface, priority) tuples. The iterable of (interface, priority) tuples it returns will then be installed.
def _getPowerupInterfaces(obj):
Undocumented
def _installOn(self, target, __explicitlyInstalled=False):
Undocumented
def uninstallFrom(self, target):

Remove this object from the target, as well as any dependencies that it automatically installed which were not explicitly "pinned" by calling "install", and raising an exception if anything still depends on this.

If the type of the object being installed has a "powerupInterfaces" attribute (containing either a sequence of interfaces, or a sequence of (interface, priority) tuples), the target will be powered down with this object on those interfaces.

If this object has a "__getPowerupInterfaces__" method, it will be called with an iterable of (interface, priority) tuples. The iterable of (interface, priority) tuples it returns will then be uninstalled.
def installedOn(self):
If this item is installed on another item, return the install target. Otherwise return None.
def installedDependents(self, target):
Return an iterable of things installed on the target that require this item.
def installedUniqueRequirements(self, target):
Return an iterable of things installed on the target that this item requires and are not required by anything else.
def installedRequirements(self, target):
Return an iterable of things installed on the target that this item requires.
def onlyInstallPowerups(self, target):
Only power up the target with this object's powerups, without interacting with the dependency system. Useful for situations where multiple instances of a class can be powered up on the same target.
API Documentation for vodafone-mobile-connect-card-driver-for-linux, generated by pydoctor at 2008-01-10 13:06:31.