slightly more verbose config debugging, and fix a ridiculous RC config bug

This commit is contained in:
Chris Jones 2008-05-23 11:31:05 +01:00
parent ea779108da
commit 0cebfd9b3c
1 changed files with 6 additions and 2 deletions

View File

@ -58,8 +58,8 @@ class TerminatorConfig:
self.sources.append (source) self.sources.append (source)
def __getattr__ (self, keyname): def __getattr__ (self, keyname):
dbg ("TConfig: Looking for: '%s'"%keyname)
for source in self.sources: for source in self.sources:
dbg ("TConfig: Looking for: '%s' in '%s'"%(keyname, source.type))
try: try:
val = getattr (source, keyname) val = getattr (source, keyname)
dbg (" TConfig: got: '%s' from a '%s'"%(val, source.type)) dbg (" TConfig: got: '%s' from a '%s'"%(val, source.type))
@ -116,8 +116,10 @@ class TerminatorConfValuestore:
def __getattr__ (self, keyname): def __getattr__ (self, keyname):
if self.values.has_key (keyname): if self.values.has_key (keyname):
dbg ("Returning '%s'"%keyname)
return self.values[keyname] return self.values[keyname]
else: else:
dbg ("Failed to find '%s'"%keyname)
raise (AttributeError) raise (AttributeError)
class TerminatorConfValuestoreDefault (TerminatorConfValuestore): class TerminatorConfValuestoreDefault (TerminatorConfValuestore):
@ -142,11 +144,13 @@ class TerminatorConfValuestoreRC (TerminatorConfValuestore):
item = item.strip () item = item.strip ()
if item and item[0] != '#': if item and item[0] != '#':
(key, value) = item.split ("=") (key, value) = item.split ("=")
dbg (" VS_RCFile: Setting value %s to %s"%(key, value)) dbg (" VS_RCFile: Setting value '%s' to '%s'"%(key, value))
if value == 'True': if value == 'True':
self.values[key] = True self.values[key] = True
elif value == 'False': elif value == 'False':
self.values[key] = False self.values[key] = False
else:
self.values[key] = value
except: except:
dbg (" VS_RCFile: Exception handling: %s"%item) dbg (" VS_RCFile: Exception handling: %s"%item)
pass pass