[Zope-Checkins] SVN: Zope/branches/2.10/ No longer opens a zodb
connection every time a ProductDispatcher is looked up.
Rocky Burt
rocky at serverzen.com
Mon Mar 5 09:20:59 EST 2007
Log message for revision 72990:
No longer opens a zodb connection every time a ProductDispatcher is looked up.
Changed:
U Zope/branches/2.10/doc/CHANGES.txt
U Zope/branches/2.10/lib/python/App/FactoryDispatcher.py
_U Zope/branches/2.10/lib/python/Products/
-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===================================================================
--- Zope/branches/2.10/doc/CHANGES.txt 2007-03-05 14:14:15 UTC (rev 72989)
+++ Zope/branches/2.10/doc/CHANGES.txt 2007-03-05 14:20:58 UTC (rev 72990)
@@ -8,6 +8,9 @@
Bugs fixed
+ - No longer opens a zodb connection every time a ProductDispatcher
+ is looked up.
+
- Collector #2288: @ and + should not be quoted when forming
request URLs in BaseRequest and HTTPRequest
Modified: Zope/branches/2.10/lib/python/App/FactoryDispatcher.py
===================================================================
--- Zope/branches/2.10/lib/python/App/FactoryDispatcher.py 2007-03-05 14:14:15 UTC (rev 72989)
+++ Zope/branches/2.10/lib/python/App/FactoryDispatcher.py 2007-03-05 14:20:58 UTC (rev 72990)
@@ -26,32 +26,15 @@
zope2 packages and those without the Products namespace package.
"""
- old_product_packages = {}
+ packages = {}
for x in dir(Products):
m = getattr(Products, x)
if isinstance(m, types.ModuleType):
- old_product_packages[x] = m
+ packages[x] = m
+
+ for m in getattr(Products, '_registered_packages', []):
+ packages[m.__name__] = m
- packages = {}
- app = Zope2.app()
- try:
- products = app.Control_Panel.Products
-
- for product_id in products.objectIds():
- product = products[product_id]
- if hasattr(product, 'package_name'):
- pos = product.package_name.rfind('.')
- if pos > -1:
- packages[product_id] = __import__(product.package_name,
- globals(), {},
- product.package_name[pos+1:])
- else:
- packages[product_id] = __import__(product.package_name)
- elif old_product_packages.has_key(product_id):
- packages[product_id] = old_product_packages[product_id]
- finally:
- app._p_jar.close()
-
return packages
class ProductDispatcher(Acquisition.Implicit):
Property changes on: Zope/branches/2.10/lib/python/Products
___________________________________________________________________
Name: svn:externals
- Five svn://svn.zope.org/repos/main/Products.Five/tags/1.5.2
+ Five svn://svn.zope.org/repos/main/Products.Five/tags/1.5.2-plus-registerPackage-fix
More information about the Zope-Checkins
mailing list