Table of Contents

Module: api_impl ./src/peak/config/api_impl.py

Configuration Management API

Imported modules   
from config_components import lookup, ConfigurationRoot, Value, parentProviding
from interfaces import *
from peak.api import exceptions, NOT_FOUND, NOT_GIVEN, PropertyName, adapt
Functions   
getProperty
makeRoot
setDefaultFor
setPropertyFor
setRuleFor
  getProperty 
getProperty (
        obj,
        propName,
        default=NOT_GIVEN,
        )

DEPRECATED: use config.lookup() instead

  makeRoot 
makeRoot ( **options )

Create a configuration root, suitable for use as a parent component

This creates and returns a new IConfigurationRoot with its default configuration loading from peak.ini. The returned root component will "know" it is a root, so any components that use it as a parent will get their uponAssembly() events invoked immediately.

Normally, this function is called without any parameters, but it will also accept keyword arguments that it will pass along when it calls the peak.config.config_components.ConfigurationRoot constructor.

Currently, the only acceptable keyword argument is iniFiles, which must be a sequence of filename strings or (moduleName,fileName) tuples.

The default value of iniFiles is [("peak","peak.ini")], which loads useful system defaults from peak.ini in the peak package directory. Files are loaded in the order specified, with later files overriding earlier ones, unless the setting to be overridden has already been used (in which case an AlreadyRead error occurs).

  setDefaultFor 
setDefaultFor (
        obj,
        propName,
        defaultObj,
        )

DEPRECATED

  setPropertyFor 
setPropertyFor (
        obj,
        propName,
        value,
        )

DEPRECATED

  setRuleFor 
setRuleFor (
        obj,
        propName,
        ruleObj,
        )

DEPRECATED


Table of Contents

This document was automatically generated on Tue Feb 17 19:55:40 2004 by HappyDoc version 2.1