Module config :: Class Reference
[show private | hide private]
[frames | no frames]

Type Reference

object --+
         |
        Reference


This internal class implements a value which is a reference to another value.
Method Summary
  __init__(self, config, type, ident)
Initialize an instance.
  __repr__(self)
  __str__(self)
  addElement(self, type, ident)
Add an element to the reference.
Config findConfig(self, container)
Find the closest enclosing configuration to the specified container.
any resolve(self, container)
Resolve this instance in the context of a container.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
Return hash(x)...
  __new__(T, S, ...)
Return a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Method Details

__init__(self, config, type, ident)
(Constructor)

Initialize an instance.
Parameters:
config - The configuration which contains this reference.
           (type=A Config instance.)
type - The type of reference.
           (type=BACKTICK or DOLLAR)
ident - The identifier which starts the reference.
           (type=str)
Overrides:
__builtin__.object.__init__

__repr__(self)
(Representation operator)

Overrides:
__builtin__.object.__repr__

__str__(self)
(Informal representation operator)

Overrides:
__builtin__.object.__str__

addElement(self, type, ident)

Add an element to the reference.
Parameters:
type - The type of reference.
           (type=BACKTICK or DOLLAR)
ident - The identifier which continues the reference.
           (type=str)

findConfig(self, container)

Find the closest enclosing configuration to the specified container.
Parameters:
container - The container to start from.
           (type=Container)
Returns:
The closest enclosing configuration, or None.
           (type=Config)

resolve(self, container)

Resolve this instance in the context of a container.
Parameters:
container - The container to resolve from.
           (type=Container)
Returns:
The resolved value.
           (type=any)
Raises:
ConfigResolutionError - If resolution fails.