summaryrefslogtreecommitdiff
path: root/repoze/bfg/registry.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2008-08-30 17:50:22 +0000
committerChris McDonough <chrism@agendaless.com>2008-08-30 17:50:22 +0000
commit7970bf558b303578e65fe95d064cf7408721cbe3 (patch)
treef8bf351989d990f9698b94d5ffc94bd4c7af16f8 /repoze/bfg/registry.py
parente6b6cce0e019964ba9168e33907c4b4a929ae733 (diff)
downloadpyramid-7970bf558b303578e65fe95d064cf7408721cbe3.tar.gz
pyramid-7970bf558b303578e65fe95d064cf7408721cbe3.tar.bz2
pyramid-7970bf558b303578e65fe95d064cf7408721cbe3.zip
Make WSGIApplicationEvent test work again.
Diffstat (limited to 'repoze/bfg/registry.py')
-rw-r--r--repoze/bfg/registry.py27
1 files changed, 13 insertions, 14 deletions
diff --git a/repoze/bfg/registry.py b/repoze/bfg/registry.py
index 9301b950b..7d27a7126 100644
--- a/repoze/bfg/registry.py
+++ b/repoze/bfg/registry.py
@@ -33,20 +33,19 @@ def setRegistryManager(manager): # for unit tests
return old_registry_manager
def makeRegistry(filename, package, options=None, lock=threading.Lock()):
- # This is absurd and probably not worth it. We want to try to
- # push our ZCML-defined configuration into an app-local component
- # registry in order to allow more than one bfg app to live in the
- # same process space without one unnecessarily stomping on the
- # other's component registrations (although I suspect directives
- # that side effects are going to fail). The only way to do that
- # currently is to override zope.component.getGlobalSiteManager for
- # the duration of the ZCML includes. We acquire a lock in case
- # another make_app runs in a different thread simultaneously, in a
- # vain attempt to prevent mixing of registrations. There's not
- # much we can do about non-make_app code that tries to use the
- # global site manager API directly in a different thread while we
- # hold the lock. Those registrations will end up in our
- # application's registry.
+ # We push our ZCML-defined configuration into an app-local
+ # component registry in order to allow more than one bfg app to
+ # live in the same process space without one unnecessarily
+ # stomping on the other's component registrations (although I
+ # suspect directives that have side effects are going to fail).
+ # The only way to do that currently is to override
+ # zope.component.getGlobalSiteManager for the duration of the ZCML
+ # includes. We acquire a lock in case another make_app runs in a
+ # different thread simultaneously, in a vain attempt to prevent
+ # mixing of registrations. There's not much we can do about
+ # non-make_app code that tries to use the global site manager API
+ # directly in a different thread while we hold the lock. Those
+ # registrations will end up in our application's registry.
lock.acquire()
try:
registry = Components(package.__name__)