r125 - branches/rewrite/src

Nat Budin partial-mirror-devel@lists.alioth.debian.org
Thu, 01 Jul 2004 21:28:31 -0600


Author: natbudin-guest
Date: Thu Jul  1 21:28:31 2004
New Revision: 125

Modified:
   branches/rewrite/src/Config.py
Log:
Reverted some changes to unbreak Config.py.


Modified: branches/rewrite/src/Config.py
==============================================================================
--- branches/rewrite/src/Config.py	(original)
+++ branches/rewrite/src/Config.py	Thu Jul  1 21:28:31 2004
@@ -17,7 +17,7 @@
 # $Id$
 
 from logging import *
-from ConfigParser import ConfigParser
+from ConfigParser import ConfigParser, DEFAULTSECT
 from sys import exit
 
 class InvalidOption(Exception):
@@ -71,16 +71,20 @@
 	
 	# Read the default section.
         self['DEFAULT'] = {}
-        for item, value in conf.items('DEFAULT'):
+        for item, value in conf.items(DEFAULTSECT):
             if item not in Config.required_in_default:
                 debug("[%s] is not allowed in default section." % (item))
                 raise InvalidOption('DEFAULT', item)
             self['DEFAULT'][item] = value
 	    
 	for section in conf.sections():
-            if section == 'DEFAULT': continue # already parsed
 	    self[section] = {}
 	    for item, value in conf.items(section):
+		# is this item from the default section?  if so, go on to the
+		# next item
+		if self['DEFAULT'].has_key(item):
+		    if self['DEFAULT'][item] == value:
+			continue
 		if item not in Config.allowed_in_backend:
 		    actually_its_ok = False
 		    for allowed_key in Config.allowed_in_backend:
@@ -121,5 +125,6 @@
         print 'get_suggests = ', self.getValue('get_suggests')
         
 
+getLogger().setLevel(DEBUG)
 conf = Config('../etc/debpartial-mirror.conf')
 conf.dump()