[Subversion] / PEAK / src / peak / peak.ini  

View of /PEAK/src/peak/peak.ini

Parent Directory | Revision Log
Revision: 640 - (download)
Fri Nov 8 03:11:08 2002 UTC (21 years, 5 months ago) by pje
File size: 5004 byte(s)
Added working support for Gadfly.  Misc. cleanups/fixes and TODO updates.
[peak.config.loaders]

# This section defines the types of data that can be used in 
# "[Load Settings From]" sections.  Each entry is either the loading function
# to be used, or an import string specifying the loading function.  Loading
# functions must conform to the 'config.ISettingLoader' interface.

file    = "peak.config.config_components:loadConfigFile"
mapping = "peak.config.config_components:loadMapping"


[peak.running.cluster]

* = importString('peak.running.clusters:loadCluster')(
        propertyName, ruleName, targetObj
    )

_filename = config.getProperty('__main__.CLUSTER', targetObj, default=None)























[peak.naming]

initialContextFactory = "peak.naming.contexts:AbstractContext"

creationParent  = None
objectFactories = binding.findUtilities(naming.IObjectFactory, targetObj)
stateFactories  = binding.findUtilities(naming.IStateFactory,  targetObj)


[peak.naming.schemes]

# This section defines naming context factories or ParsedURL subclasses to
# be used for various URL schemes.  The entry name is the URL scheme, and
# the value is either the object or an import string for loading it.

import  = "peak.naming.factories.peak_imports:importURL"
smtp    = "peak.naming.factories.smtp:smtpURL"
uuid    = "peak.naming.factories.uuid:uuidURL"
ldap    = "peak.storage.LDAP:ldapURL"
sybase  = "peak.storage.SQL:GenericSQL_URL"
gadfly  = "peak.storage.SQL:GadflyURL"

lockfile    = "peak.running.lockfiles:lockfileURL"
nulllockfile= "peak.running.lockfiles:lockfileURL"
shlockfile  = "peak.running.lockfiles:lockfileURL"
flockfile   = "peak.running.lockfiles:lockfileURL"
winflockfile= "peak.running.lockfiles:lockfileURL"














[Provide Utilities]

# "Provide Utilities" sections define utilities by mapping from an import
# string for an interface, to an expression defining the Provider.  
#
# Note that unlike property sections, code in "Provide utilities" sections is
# executed immediately to create a provider rule, not on-demand when the 
# utility is actually requested, so you should avoid code that does unnecessary
# importing.  You'll notice that the providers shown here do their imports
# inside of lambdas within binding.Provider() calls.

# Our first provider is a global default for the 'naming.IObjectFactory'
# interface, which "bottoms out" the search for object factories by providing
# default behavior for creating objects from state found in a naming context.

peak.naming.interfaces.IObjectFactory =

    binding.Provider(
        lambda forObj:
            importString('peak.naming.spi')
    )


# This next provider associates a default transaction service with the
# nearest localConfig above the object that the service is wanted for.  It
# creates a TransactionService instance with that config as its parent
# component.

peak.storage.interfaces.ITransactionService =

    binding.CachingProvider(

        lambda foundIn: 
            importString('peak.storage.transactions.TransactionService')(
                foundIn
            ),

        local = True,
    )


[__main__]

# The '__main__' namespace will be used by PEAK for global settings that
# can be set either in the application's main startup script (i.e. the
# Python '__main__' module) or the environment.  The following rule
# sets up a fallback from the '__main__' namespace to the 'environ'
# namespace, so that anything not supplied by the startup script will
# be supplied by the environment.

* = config.getProperty(
        'environ.'+propertyName.split('.',1)[1], default=NOT_FOUND
    )

[Load Settings From]

# "Load Settings From" sections are processed in-line to load settings from
# other sources.  'file=' entries act like "include" operations, loading
# configuration files in the same format.  'mapping=' entries load Python
# mapping objects.  The first argument is the filename or mapping object,
# respectively, and the second argument, if present, is a prefix to be used
# on property names found in the specified mapping or file.
#
# Note that "Load Settings From" sections are executed at the point where they
# appear in the file, and a snapshot of the data source is taken at that time.
# If a data source (file, mapping, etc.) changes later, it will have no effect
# on the settings that were already loaded, although you can always load the
# settings again (assuming none of them have been used yet.
#
# In this section of peak.ini, we initialize the 'environ.*' namespace from
# Python's 'os.environ' mapping, and the '__main__.*' namespace from the
# '__main__' (startup) module's dictionary.  Finally, we load a configuration
# file specified by '__main__.PEAK_CONFIG', which allows a script to simply
# set PEAK_CONFIG to specify its main configuration file, or if not set, it
# will fall back to the PEAK_CONFIG environment variable.

mapping = importString('os.environ'),        'environ.*'
mapping = importString('__main__').__dict__, '__main__.*'

file    = config.getProperty('__main__.PEAK_CONFIG', default=None)

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help