]> granicus.if.org Git - python/commitdiff
From SF patch 638299 [by Vinaj]: fileConfig() now takes an optional
authorGuido van Rossum <guido@python.org>
Thu, 14 Nov 2002 12:52:17 +0000 (12:52 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 14 Nov 2002 12:52:17 +0000 (12:52 +0000)
defaults dictionary parameter which is passed to ConfigParser.

Lib/logging/config.py

index 760da08f5abb7bb1f7ee61dec190721094dc427d..4a7832b455e4004d0287e21758b90c99a5e23aa1 100644 (file)
@@ -40,7 +40,7 @@ DEFAULT_LOGGING_CONFIG_PORT = 9030
 #   _listener holds the server object doing the listening
 _listener = None
 
-def fileConfig(fname):
+def fileConfig(fname, defaults=None):
     """
     Read the logging configuration from a ConfigParser-format file.
 
@@ -55,7 +55,7 @@ def fileConfig(fname):
     """
     import ConfigParser
 
-    cp = ConfigParser.ConfigParser()
+    cp = ConfigParser.ConfigParser(defaults)
     if hasattr(cp, 'readfp') and hasattr(fname, 'readline'):
         cp.readfp(fname)
     else: