Jump to revision: | |
---|---|
Author: | pje |
Date: | Sun Nov 30 00:12:28 2003 UTC (20 years, 4 months ago) |
Log Message:
Configuration system cleanups and new features: - Replaced the "[Provide Utilities]" section of .ini files with "[Component Factories]". The new section type is easier to use, much more versatile, and does all registration and imports lazily. See the 'peak.ini' file for docs. "[Provide Utilities]" and 'config.ProvideInstance()' are now DEPRECATED, so please convert ASAP. - 'binding.Make()' now accepts configuration keys, using them to look up a factory object that's then invoked to create the attribute. This makes it a lot easier to define a component with its own transaction service, 'IBasicReactor', or other normally "global" component. It also makes it easier to globally specify a factory class for some interface. Factories are looked up under the 'config.FactoryFor(key)' configuration key. (See below.) - Added 'config.FactoryFor(key)', a 'config.IConfigKey' implementation that provides a configuration namespace for factories. When you use 'binding.Make(ISomething)', it's roughly equivalent to:: binding.Make( lambda self,d,a: binding.lookupComponent( self, config.FactoryFor(ISomething), adaptTo = binding.IRecipe )(self,d,a) ) That is, the 'config.FactoryFor(ISomething)' is looked up and invoked. - Added 'config.CreateViaFactory(key)', a 'config.IRule' implementation that creates an implementation of 'key', by looking up 'config.FactoryFor(key)'and invoking it. - Added 'config.ruleForExpr(name,expr)', that returns a 'config.IRule' that computes the Python expression in the string 'expr'. This is the mechanism used by configuration files to create rules, factored out into an API call so that configuration extensions can use it, too.
Changed paths:
Path | Action | Text Changes | Prop Changes | Diff to Previous |
---|---|---|---|---|
PEAK/CHANGES.txt | modified | X | (diff to previous) | |
PEAK/src/peak/binding/once.py | modified | X | (diff to previous) | |
PEAK/src/peak/config/config_components.py | modified | X | (diff to previous) | |
PEAK/src/peak/config/tests/__init__.py | modified | X | (diff to previous) | |
PEAK/src/peak/peak.ini | modified | X | (diff to previous) |
cvs-admin@eby-sarna.com Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |