[Checkins] SVN: GenericSetup/trunk/ Merge changes from 1.3 branch
Wichert Akkerman
wichert at wiggy.net
Tue Aug 7 08:55:14 EDT 2007
Log message for revision 78666:
Merge changes from 1.3 branch
Changed:
U GenericSetup/trunk/CHANGES.txt
U GenericSetup/trunk/README.txt
U GenericSetup/trunk/components.py
-=-
Modified: GenericSetup/trunk/CHANGES.txt
===================================================================
--- GenericSetup/trunk/CHANGES.txt 2007-08-07 12:49:43 UTC (rev 78665)
+++ GenericSetup/trunk/CHANGES.txt 2007-08-07 12:55:14 UTC (rev 78666)
@@ -1,12 +1,33 @@
GenericSetup Product Changelog
- - components: Removed non-functional support for registering objects in
- nested folders. We only support objects available in the component
- registry's parent now. The component registry needs to be either
- acquisition wrapped or have a __parent__ pointer to get to the parent.
- GenericSetup 1.3-beta (07/12/2007)
+ GenericSetup 1.3.1 (unreleased)
+ - components: correct the object path for the site root to be the
+ empty string.
+
+ - components: Made output more diff friendly.
+
+ - utils: Added warnings to old code.
+ ImportConfiguratorBase and ExportConfiguratorBase will become deprecated
+ as soon as GenericSetup itself no longer uses them. HandlerBase is now
+ deprecated.
+
+ - components: Added 'components_xmlconfig.html' form.
+ This view allows to inspect and edit component registrations. It is also
+ available under the ZMI tab 'manage_components'.
+
+
+ GenericSetup 1.3 (2007/07/26)
+
+ - components: Removed non-functional support for registering objects in
+ nested folders. We only support objects available in the component
+ registry's parent now. The component registry needs to be either
+ acquisition wrapped or have a __parent__ pointer to get to the parent.
+
+
+ GenericSetup 1.3-beta (2007/07/12)
+
- Guard against situations where encoded text may be compared by the
differ.
(http://www.zope.org/Collectors/CMF/471)
Modified: GenericSetup/trunk/README.txt
===================================================================
--- GenericSetup/trunk/README.txt 2007-08-07 12:49:43 UTC (rev 78665)
+++ GenericSetup/trunk/README.txt 2007-08-07 12:55:14 UTC (rev 78666)
@@ -21,6 +21,9 @@
- (x) properties of the site object
+ - (x) placeful utilities and adapters registered in the local
+ site manager. Placeless utilities can only be imported.
+
Extending The Tool
Third-party products extend the tool by registering handlers for
Modified: GenericSetup/trunk/components.py
===================================================================
--- GenericSetup/trunk/components.py 2007-08-07 12:49:43 UTC (rev 78665)
+++ GenericSetup/trunk/components.py 2007-08-07 12:55:14 UTC (rev 78666)
@@ -118,7 +118,15 @@
provided=provided,
name=name)
+ def _getSite(self):
+ # Get the site by either __parent__ or Acquisition
+ site = getattr(self.context, '__parent__', None)
+ if site is None:
+ site = aq_parent(self.context)
+ return site
+
def _initUtilities(self, node):
+ site = self._getSite()
for child in node.childNodes:
if child.nodeName != 'utility':
continue
@@ -134,10 +142,6 @@
obj_path = child.getAttribute('object')
if not component and not factory and obj_path is not None:
- # Get the site by either __parent__ or Acquisition
- site = getattr(self.context, '__parent__', None)
- if site is None:
- site = aq_parent(self.context)
# Support for registering the site itself
if obj_path in ('', '/'):
obj = site
@@ -201,6 +205,7 @@
for reg in self.context.registeredUtilities() ]
registrations.sort(key=itemgetter('name'))
registrations.sort(key=itemgetter('provided'))
+ site = aq_base(self._getSite())
for reg_info in registrations:
child = self._doc.createElement('utility')
@@ -214,7 +219,10 @@
# check if the component is acquisition wrapped. If it is, export
# an object reference instead of a factory reference
if getattr(comp, 'aq_base', None) is not None:
- child.setAttribute('object', comp.getId())
+ if aq_base(comp) is site:
+ child.setAttribute('object', '')
+ else:
+ child.setAttribute('object', comp.getId())
else:
factory = _getDottedName(type(comp))
child.setAttribute('factory', factory)
More information about the Checkins
mailing list