Improve configclass debug output a little, and be safer about a variable that might not exist
This commit is contained in:
parent
65cb27c2bb
commit
4991b0ae21
|
@ -58,16 +58,16 @@ class TerminatorConfig:
|
||||||
self.sources.append (source)
|
self.sources.append (source)
|
||||||
|
|
||||||
def __getattr__ (self, keyname):
|
def __getattr__ (self, keyname):
|
||||||
dbg ("Config: Looking for: %s"%keyname)
|
dbg ("TConfig: Looking for: '%s'"%keyname)
|
||||||
for source in self.sources:
|
for source in self.sources:
|
||||||
try:
|
try:
|
||||||
val = getattr (source, keyname)
|
val = getattr (source, keyname)
|
||||||
dbg ("Config: got: %s from a %s"%(val, source.type))
|
dbg (" TConfig: got: '%s' from a '%s'"%(val, source.type))
|
||||||
return (val)
|
return (val)
|
||||||
except:
|
except:
|
||||||
dbg ("Config: no value found in %s."%source.type)
|
dbg (" TConfig: no value found in '%s'."%source.type)
|
||||||
pass
|
pass
|
||||||
dbg ("Config: Out of sources")
|
dbg (" TConfig: Out of sources")
|
||||||
raise (AttributeError)
|
raise (AttributeError)
|
||||||
|
|
||||||
class TerminatorConfValuestore:
|
class TerminatorConfValuestore:
|
||||||
|
@ -185,7 +185,7 @@ class TerminatorConfValuestoreGConf (TerminatorConfValuestore):
|
||||||
# FIXME: Do we need to watch more non-profile stuff here?
|
# FIXME: Do we need to watch more non-profile stuff here?
|
||||||
|
|
||||||
def set_reconfigure_callback (self, function):
|
def set_reconfigure_callback (self, function):
|
||||||
dbg ("Config: setting callback to: %s"%function)
|
dbg (" VSConf: setting callback to: %s"%function)
|
||||||
self.reconfigure_callback = function
|
self.reconfigure_callback = function
|
||||||
return (True)
|
return (True)
|
||||||
|
|
||||||
|
@ -196,6 +196,7 @@ class TerminatorConfValuestoreGConf (TerminatorConfValuestore):
|
||||||
|
|
||||||
def __getattr__ (self, key = ""):
|
def __getattr__ (self, key = ""):
|
||||||
ret = None
|
ret = None
|
||||||
|
value = None
|
||||||
|
|
||||||
dbg (' VSGConf: preparing: %s/%s'%(self.profile, key))
|
dbg (' VSGConf: preparing: %s/%s'%(self.profile, key))
|
||||||
|
|
||||||
|
@ -204,7 +205,7 @@ class TerminatorConfValuestoreGConf (TerminatorConfValuestore):
|
||||||
value = self.client.get ('/desktop/gnome/interface/monospace_font_name')
|
value = self.client.get ('/desktop/gnome/interface/monospace_font_name')
|
||||||
else:
|
else:
|
||||||
value = self.client.get ('%s/%s'%(self.profile, key))
|
value = self.client.get ('%s/%s'%(self.profile, key))
|
||||||
dbg ('VSGConf: getting: %s'%value)
|
|
||||||
if value:
|
if value:
|
||||||
funcname = "get_" + self.defaults[key][0].__name__
|
funcname = "get_" + self.defaults[key][0].__name__
|
||||||
# Special case for str
|
# Special case for str
|
||||||
|
|
Loading…
Reference in New Issue