| Class: Namespace | ./src/peak/config/config_components.py | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Traverse to another property namespaceUse this in .ini files (e.g. '__main__. = config.Namespace("environ.")') to create a rule that looks up undefined properties in another property namespace. Or, use this as a way to treat a property namespace as a mapping object:
myNS = config.Namespace("some.prefix", aComponent)
myNS['spam.bayes'] # property 'some.prefix.spam.bayes'
myNS.get('something',default) # property 'some.prefix.something'
Or use this in a component class to allow traversing to a property space:
class MyClass(binding.Component):
appConfig = binding.Make(
config.Namespace('MyClass.conf')
)
something = binding.Obtain('appConfig/foo.bar.baz')
In the example above,
|