Table of Contents

Class: Delegate ./src/peak/binding/components.py

Delegate attribute to the same attribute of another object

Usage:

        class PasswordFile(binding.Component):
            shadow = binding.Obtain('config:etc.shadow/')
            checkPwd = changePwd = binding.Delegate('shadow')

The above is equivalent to this longer version:

        class PasswordFile(binding.Component):
            shadow = binding.Obtain('config:etc.shadow/')
            checkPwd = binding.Obtain('shadow/checkPwd')
            changePwd = binding.Obtain('shadow/changePwd')

Because Delegate uses the attribute name being looked up, you do not need to create a separate binding for each attribute that is delegated, as you do when using Obtain().

Base Classes   
Make
Methods   
__init__
__repr__
  __init__ 
__init__ (
        self,
        delegateAttr,
        metadata=None,
        **kw,
        )

  __repr__ 
__repr__ ( self )


Table of Contents

This document was automatically generated on Mon May 6 01:11:02 2024 by HappyDoc version 2.1