[Subversion] / PEAK / src / peak / util / EigenData.py |
No default branch
Bookmark a link to HEAD:
(view)
(download)
(as text)
"Global" services defined by '[Component Factories]' sections now live in the closest "service area" to the component that requests them. A "service area" is a parent component that implements 'config.IServiceArea', such as a configuration root returned by 'config.makeRoot()'. Applications loaded by the 'peak runIni' command are now created in their own service area, which means that settings in the .ini file being run will apply to services the application uses. (Because the application will have its own, application-specific service instances, and they will use the configuration loaded into the service area.) For more information, see CHANGES.txt, and especially: http://www.eby-sarna.com/pipermail/peak/2004-January/001087.html
It's now possible to declare an attribute as offering a wildcard property; such lookups now follow the same rules as other wildcard property lookups. The 'config.IConfigKey' interface has been changed to cleanly support implied keys at both registration and lookup time, so you can implement your own key types that work the way interfaces or property names do for configuration lookups. I also moved the 'EigenRegistry' class from 'peak.util.EigenData' to 'peak.config.registries', as it hasn't really been useful outside PEAK for a while now.
The 'provides' keyword argument to various 'peak.binding' APIs has been renamed to 'offerAs', and it must be a sequence of configuration keys. (Previously, it accepted either a single key or a tuple of keys.) The signature of 'binding.Constant()' was changed as well; the first positional argument is now the constant value, and 'offerAs' is now a keyword argument. (Previously, 'provides' was the first positional argument of 'binding.Constant()'.) The 'registerProvider()' method of 'config.IConfigurable()' also now accepts only a single configuration key, as does 'EigenRegistry.register()'.
Fixed bugs found by Alexander Smishlajev's "Echo" class. Specifically, I put back code to ensure that EigenRegistry and PropertyMap always use the "narrowest" interface possible, but it now uses a depth value to do so, which I find easier to understand than the old 'extends()' logic. It also corresponds to the same logic used in the protocols package. Anyway, the absence of this meant that ITwistedReactor was looked for even if IBasicReactor would suffice. I put back the tests that checked this sort of thing, at least for EigenRegistry. The second bug was that if a component with an "assembled" parent didn't have any children already waiting for an assembly event, it didn't request notification for events, and thus never notified any children that subscribed later. I fixed this by having components register with their parents when their children register with them, if it is the first such registration and the component would not have otherwise registered with its parent. Added a test case to cover this scenario.
Finished switchover to using protocols.advise() API to declare interfaces.
'EigenRegistry' and 'PropertyMap' no longer attempt to figure out whether implied (i.e. inherited) interfaces are more or less general with respect to a previous registration. This was behavior that emulated Zope adapter registries, but what we really wanted was more akin to a Zope "type" registry. The only parts of the test suite that used the old behavior were the tests specifically written to ensure that behavior! Also, changed the implementation of '__class_provides__' so that the registry becomes immutable as soon as it is computed by the class.
Normalized whitespace.
Fixed needing to break encapsulation of EigenCells in order to supply a default value. 'EigenCell.get()' can now be given a function that will be called to suppy a default value for the cell in the event that it hasn't had a value set yet, and has not been read. This cleans up code in the singleton accessors for the "system configuration" and "reactor" services.
PEAK-Zope namegeddon, phase 1. Routed all imports of Interface and Persistence through 'peak.interface' and 'peak.persistence'. Future phases will replace the bundled Interface and Persistence packages with the latest and greatest from Zope X3, updating the plugpoint modules appropriately. Also, this arrangement will let us experiment with a PEP 246 implementation as part of 'peak.interface', and prepare for the coming "interface declarations" of Zope X3.
Changed to use Interface.getBases() method instead of accessing __bases__ directly. This will help later if/when we use EigenRegistries for Properties as well as Interfaces.
Added test suite for EigenData module, and fixed some minor issues with it and binding.components.
Revised EigenRegistry registration algorithm to Zope 3-style conservativism; added conservative "update" method as well.
Added 'EigenRegistry' class, for future support of Utility registries.
Initial draft of 'TW.Utils.EigenData' -- support for write-many-until-read configuration data.
cvs-admin@eby-sarna.com Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |