[Zope-Checkins] CVS: Zope3/src/zdaemon - zdoptions.py:1.27

Fred L. Drake, Jr. fred at zope.com
Fri Feb 20 15:14:37 EST 2004


Update of /cvs-repository/Zope3/src/zdaemon
In directory cvs.zope.org:/tmp/cvs-serv28308

Modified Files:
	zdoptions.py 
Log Message:
backport support for locating a default configfile from the Zope 3
version of zdoptions; we now use this version for everyone


=== Zope3/src/zdaemon/zdoptions.py 1.26 => 1.27 ===
--- Zope3/src/zdaemon/zdoptions.py:1.26	Wed Jan 14 10:28:07 2004
+++ Zope3/src/zdaemon/zdoptions.py	Fri Feb 20 15:14:37 2004
@@ -254,6 +254,8 @@
                 if name and value is not None:
                     setattr(self, name, value)
 
+        if self.configfile is None:
+            self.configfile = self.default_configfile()
         if self.zconfig_options and self.configfile is None:
             self.usage("configuration overrides (-X) cannot be used"
                        " without a configuration file")
@@ -293,6 +295,16 @@
             if (os.getenv("EVENT_LOG_FILE") is None and
                 os.getenv("STUPID_LOG_FILE") is None):
                 self.load_logconf(self.logsectionname)
+
+    def default_configfile(self):
+        """Return the name of the default config file, or None."""
+        # This allows a default configuration file to be used without
+        # affecting the -C command line option; setting self.configfile
+        # before calling realize() makes the -C option unusable since
+        # then realize() thinks it has already seen the option.  If no
+        # -C is used, realize() will call this method to try to locate
+        # a configuration file.
+        return None
 
     def load_schema(self):
         if self.schema is None:




More information about the Zope-Checkins mailing list