[Checkins]
SVN: Products.GenericSetup/branches/1.3/Products/GenericSetup/
restored r81266 from GenericSetup/branches/1.3:
Yvo Schubbe
y.2007- at wcm-solutions.de
Tue Nov 27 15:53:00 EST 2007
Log message for revision 81995:
restored r81266 from GenericSetup/branches/1.3:
Fixed toolset import handler not to initialize tools again, when they already exist in the site.
Changed:
U Products.GenericSetup/branches/1.3/Products/GenericSetup/CHANGES.txt
U Products.GenericSetup/branches/1.3/Products/GenericSetup/tool.py
-=-
Modified: Products.GenericSetup/branches/1.3/Products/GenericSetup/CHANGES.txt
===================================================================
--- Products.GenericSetup/branches/1.3/Products/GenericSetup/CHANGES.txt 2007-11-27 20:00:19 UTC (rev 81994)
+++ Products.GenericSetup/branches/1.3/Products/GenericSetup/CHANGES.txt 2007-11-27 20:52:59 UTC (rev 81995)
@@ -1,12 +1,15 @@
GenericSetup Product Changelog
GenericSetup 1.3.3 (unreleased)
-
+
- Be more careful in checking context id validity.
- Fire events before and after importing.
+ - tool: Fixed toolset import handler not to initialize tools again, when
+ they already exist in the site.
+
GenericSetup 1.3.2 (2007/09/11)
- Ignore import and export step handlers that we can not resolve.
Modified: Products.GenericSetup/branches/1.3/Products/GenericSetup/tool.py
===================================================================
--- Products.GenericSetup/branches/1.3/Products/GenericSetup/tool.py 2007-11-27 20:00:19 UTC (rev 81994)
+++ Products.GenericSetup/branches/1.3/Products/GenericSetup/tool.py 2007-11-27 20:52:59 UTC (rev 81995)
@@ -27,6 +27,7 @@
from OFS.Folder import Folder
from OFS.Image import File
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
+from ZODB.POSException import ConflictError
from zope.interface import implements
from zope.interface import implementedBy
@@ -105,23 +106,25 @@
tool_class = _resolveDottedName(info['class'])
existing = getattr(aq_base(site), tool_id, None)
- try:
- new_tool = tool_class()
- except TypeError:
- new_tool = tool_class(tool_id)
- else:
+ # Don't even initialize the tool again, if it already exists.
+ if existing is None:
try:
- new_tool._setId(tool_id)
- except: # XXX: ImmutableId raises result of calling MessageDialog
- pass
+ new_tool = tool_class()
+ except TypeError:
+ new_tool = tool_class(tool_id)
+ else:
+ try:
+ new_tool._setId(tool_id)
+ except (ConflictError, KeyboardInterrupt):
+ raise
+ except:
+ # XXX: ImmutableId raises result of calling MessageDialog
+ pass
- if existing is None:
site._setObject(tool_id, new_tool)
-
else:
unwrapped = aq_base(existing)
if not isinstance(unwrapped, tool_class):
-
site._delObject(tool_id)
site._setObject(tool_id, tool_class())
More information about the Checkins
mailing list