[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/component/hooks.py Registered hook reset with the teardown mechanism.

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Oct 11 16:55:18 EDT 2005


Log message for revision 39076:
  Registered hook reset with the teardown mechanism.
  
  

Changed:
  U   Zope3/trunk/src/zope/app/component/hooks.py

-=-
Modified: Zope3/trunk/src/zope/app/component/hooks.py
===================================================================
--- Zope3/trunk/src/zope/app/component/hooks.py	2005-10-11 20:54:48 UTC (rev 39075)
+++ Zope3/trunk/src/zope/app/component/hooks.py	2005-10-11 20:55:18 UTC (rev 39076)
@@ -40,7 +40,7 @@
         adapter_hook = self.sm.adapters.adapter_hook
         self.adapter_hook = adapter_hook
         return adapter_hook
-    
+
     adapter_hook = read_property(adapter_hook)
 
 siteinfo = SiteInfo()
@@ -56,7 +56,7 @@
         # We should really look look at this again though, especially
         # once site managers do less.  There's probably no good reason why
         # they can't be proxied.  Well, except maybe for performance.
-        
+
         site = zope.security.proxy.removeSecurityProxy(site)
         sm = site.getSiteManager()
 
@@ -66,7 +66,7 @@
         del siteinfo.adapter_hook
     except AttributeError:
         pass
-    
+
 def getSite():
     return siteinfo.site
 
@@ -113,3 +113,8 @@
     zope.component.getSiteManager.reset()
     # BBB: Goes away in 3.3.
     zope.component.getServices.reset()
+
+# Clear the site thread global
+clearSite = setSite
+from zope.testing.cleanup import addCleanUp
+addCleanUp(resetHooks)



More information about the Zope3-Checkins mailing list