[Checkins] SVN: Products.GenericSetup/trunk/Products/GenericSetup/ Fix utility removal so utility is not added when it is missing from the local component registry.
Wichert Akkerman
wichert at wiggy.net
Sat Sep 19 03:33:26 EDT 2009
Please add a test for this change as well.
On 2009-9-18 17:35, Laurence Rowe wrote:
> Log message for revision 104351:
> Fix utility removal so utility is not added when it is missing from the local component registry.
>
> Changed:
> U Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt
> U Products.GenericSetup/trunk/Products/GenericSetup/components.py
>
> -=-
> Modified: Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt
> ===================================================================
> --- Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt 2009-09-18 15:32:48 UTC (rev 104350)
> +++ Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt 2009-09-18 15:35:57 UTC (rev 104351)
> @@ -4,6 +4,9 @@
> GenericSetup 1.5.0 (unreleased)
> -------------------------------
>
> +- Fix utility removal so utility is not added when it is missing from the
> + local component registry.
> +
> - Fixed component handler to use 'for' not 'for_' in adapter directive. To
> support import of existing profiles 'for_' is used as a fallback.
>
>
> Modified: Products.GenericSetup/trunk/Products/GenericSetup/components.py
> ===================================================================
> --- Products.GenericSetup/trunk/Products/GenericSetup/components.py 2009-09-18 15:32:48 UTC (rev 104350)
> +++ Products.GenericSetup/trunk/Products/GenericSetup/components.py 2009-09-18 15:35:57 UTC (rev 104351)
> @@ -172,12 +172,12 @@
> factory = child.getAttribute('factory')
> factory = factory and _resolveDottedName(factory) or None
>
> - if ( child.hasAttribute('remove') and
> - self.context.queryUtility(provided, name) is not None ):
> - ofs_id = self._ofs_id(child)
> - if ofs_id in self.context.objectIds():
> - self.context._delObject(ofs_id, suppress_events=True)
> - self.context.unregisterUtility(provided=provided, name=name)
> + if child.hasAttribute('remove'):
> + if self.context.queryUtility(provided, name) is not None:
> + ofs_id = self._ofs_id(child)
> + if ofs_id in self.context.objectIds():
> + self.context._delObject(ofs_id, suppress_events=True)
> + self.context.unregisterUtility(provided=provided, name=name)
> continue
>
> if component and factory:
>
> _______________________________________________
> checkins mailing list
> checkins at zope.org
> https://mail.zope.org/mailman/listinfo/checkins
--
Wichert Akkerman <wichert at wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
More information about the checkins
mailing list