[Zope-Checkins] SVN: Zope/trunk/lib/python/Zope/ Merge Stefan's ZOPE_CONFIG patch to the HEAD.

Chris McDonough chrism at plope.com
Fri May 28 17:06:53 EDT 2004


Log message for revision 25104:
Merge Stefan's ZOPE_CONFIG patch to the HEAD.



-=-
Modified: Zope/trunk/lib/python/Zope/Startup/run.py
===================================================================
--- Zope/trunk/lib/python/Zope/Startup/run.py	2004-05-28 20:56:36 UTC (rev 25103)
+++ Zope/trunk/lib/python/Zope/Startup/run.py	2004-05-28 21:06:53 UTC (rev 25104)
@@ -28,6 +28,9 @@
     configure('/path/to/configfile'); import Zope; app = Zope.app() """
     import Zope.Startup
     starter = Zope.Startup.get_starter()
+    if not configfile:
+        import os
+        configfile = os.getenv("ZOPE_CONFIG")
     opts = _setconfig(configfile)
     starter.setConfiguration(opts.configroot)
     starter.setupSecurityOptions()

Modified: Zope/trunk/lib/python/Zope/__init__.py
===================================================================
--- Zope/trunk/lib/python/Zope/__init__.py	2004-05-28 20:56:36 UTC (rev 25103)
+++ Zope/trunk/lib/python/Zope/__init__.py	2004-05-28 21:06:53 UTC (rev 25104)
@@ -42,6 +42,12 @@
         # Already began (and maybe finished) startup, so don't run again
         return
     _began_startup = 1
+    # Load configuration file from (optional) environment variable
+    # Also see http://zope.org/Collectors/Zope/1233
+    import os
+    configfile = os.environ.get('ZOPE_CONFIG')
+    if configfile is not None:
+        configure(configfile)
     from Zope.App.startup import startup as _startup
     _startup()
 
@@ -71,4 +77,3 @@
 if os.environ.get('ZOPE_COMPATIBLE_STARTUP'):
     # Open the database immediately (see comment above).
     startup()
-




More information about the Zope-Checkins mailing list