[Checkins] SVN: zope.paste/trunk/zope/paste/factory.py There can be only ever one Zope application (due to the global setup that Zope

Philipp von Weitershausen philikon at philikon.de
Sun Apr 1 18:56:47 EDT 2007


Log message for revision 73970:
  There can be only ever one Zope application (due to the global setup that Zope
  does when it loads the ZCML configuration, and the locks it could have on
  file storages).
  

Changed:
  U   zope.paste/trunk/zope/paste/factory.py

-=-
Modified: zope.paste/trunk/zope/paste/factory.py
===================================================================
--- zope.paste/trunk/zope/paste/factory.py	2007-04-01 21:01:59 UTC (rev 73969)
+++ zope.paste/trunk/zope/paste/factory.py	2007-04-01 22:56:47 UTC (rev 73970)
@@ -21,8 +21,13 @@
 from zope.app.appsetup.appsetup import multi_database
 from zope.app.wsgi import WSGIPublisherApplication
 
+_zope_app = None
 def zope_app_factory(global_conf, site_definition, file_storage=None,
                      db_definition=None, devmode='no'):
+    global _zope_app
+    if _zope_app is not None:
+        return _zope_app
+
     # relative filenames are understood to be relative to the
     # PasteDeploy configuration file
     def abspath(path):
@@ -55,4 +60,5 @@
     else:
         db = None
 
-    return WSGIPublisherApplication(db)
+    _zope_app = WSGIPublisherApplication(db)
+    return _zope_app



More information about the Checkins mailing list