[Zope-Checkins] SVN: Zope/trunk/ - Collector #1233: ported ZOPE_CONFIG patch from Zope 2.7 to Zope 2.8

Andreas Jung andreas at andreas-jung.com
Wed Apr 27 14:54:13 EDT 2005


Log message for revision 30205:
  - Collector #1233: ported ZOPE_CONFIG patch from Zope 2.7 to Zope 2.8
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Zope2/Startup/options.py
  U   Zope/trunk/lib/python/Zope2/__init__.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===================================================================
--- Zope/trunk/doc/CHANGES.txt	2005-04-27 17:24:00 UTC (rev 30204)
+++ Zope/trunk/doc/CHANGES.txt	2005-04-27 18:54:13 UTC (rev 30205)
@@ -20,9 +20,7 @@
    - Change acquisition wrappers to implement the descr get slot
      directly, thus speeding the use of the slot.
 
-   - Port ZOPE_CONFIG patch from Zope 2.7 to Zope 2.8
 
-
   after Zope 2.8b1 
 
     Features added
@@ -31,6 +29,7 @@
 
     Bugs fixed
   
+      - Collector #1233: ported ZOPE_CONFIG patch from Zope 2.7 to Zope 2.8
 
 
   Zope 2.8b1 (2005/04/24)

Modified: Zope/trunk/lib/python/Zope2/Startup/options.py
===================================================================
--- Zope/trunk/lib/python/Zope2/Startup/options.py	2005-04-27 17:24:00 UTC (rev 30204)
+++ Zope/trunk/lib/python/Zope2/Startup/options.py	2005-04-27 18:54:13 UTC (rev 30205)
@@ -23,3 +23,8 @@
 
     schemadir = os.path.dirname(os.path.abspath(__file__))
     schemafile = "zopeschema.xml"
+
+
+    def default_configfile(self):
+        """Use ZOPE_CONFIG if specified and -C not passed."""
+        return os.environ.get('ZOPE_CONFIG')

Modified: Zope/trunk/lib/python/Zope2/__init__.py
===================================================================
--- Zope/trunk/lib/python/Zope2/__init__.py	2005-04-27 17:24:00 UTC (rev 30204)
+++ Zope/trunk/lib/python/Zope2/__init__.py	2005-04-27 18:54:13 UTC (rev 30205)
@@ -42,8 +42,9 @@
         # Already began (and maybe finished) startup, so don't run again
         return
     _began_startup = 1
-    _configure()
+    from Zope2.Startup.run import _setconfig
     from Zope2.App.startup import startup as _startup
+    _setconfig()
     _startup()
 
 def app(*args, **kw):
@@ -57,16 +58,9 @@
     import ZPublisher
     return ZPublisher.test('Zope', *args, **kw)
 
+
 from Zope2.Startup.run import configure
 
-def _configure():
-    # 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)
-
 # Zope2.App.startup.startup() sets the following variables in this module.
 DB = None
 bobo_application = None



More information about the Zope-Checkins mailing list