Log message for revision 71334: * only register site hooks once per class
Changed: U Products.Five/branches/1.3/site/metaconfigure.py -=- Modified: Products.Five/branches/1.3/site/metaconfigure.py =================================================================== --- Products.Five/branches/1.3/site/metaconfigure.py 2006-11-29 21:50:36 UTC (rev 71333) +++ Products.Five/branches/1.3/site/metaconfigure.py 2006-11-30 00:02:17 UTC (rev 71334) @@ -43,7 +43,11 @@ if not IPossibleSite.implementedBy(site_class): raise ConfigurationError('Site class does not implement ' 'IPossibleClass: %s' % site_class) - if site_class is not None: + # only install the hook once + already = getattr(class_, '_localsite_marker', False) + + if site_class is not None and not already: + class_._localsite_marker = True _context.action( discriminator = (class_,), callable = classSiteHook, @@ -63,6 +67,8 @@ delattr(class_, 'setSiteManager') classImplementsOnly(class_, implementedBy(class_)-IPossibleSite) _localsite_monkies.remove(class_) + if getattr(class_, '_localsite_marker', False): + delattr(class_, '_localsite_marker') from zope.testing.cleanup import addCleanUp addCleanUp(uninstallSiteHooks) _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins