def addObserver(section, name, target, attr=None, dtype=str, callback=None, default=None):
 observers = config.observers.setdefault((section.lower(), name.lower()), {})
 if (not attr):
  tokens = name.lower().split()
  attr = (tokens[0] + ''.join((t.title() for t in tokens[1:])))
 log.debug('Subscribing %s.%s', target, attr)
 attr = intern(attr)
 targetref = weakref.ref(target)
 observers.setdefault((targetref, attr), callback)
 val = _getProperty(section, name, dtype, default)
 setattr(target, attr, val)
 if callback:
  callback(val)

def addObserver ( section , name , target , attr = None , dtype = str , callback = None , default = None ) : observers = config . observers . setdefault ( ( section . lower ( ) , name . lower ( ) ) , { } ) if ( not attr ) : tokens = name . lower ( ) . split ( ) attr = ( tokens [ 0 ] + '' . join ( ( t . title ( ) for t in tokens [ 1 : ] ) ) ) log . debug ( 'Subscribing %s.%s' , target , attr ) attr = intern ( attr ) targetref = weakref . ref ( target ) observers . setdefault ( ( targetref , attr ) , callback ) val = _getProperty ( section , name , dtype , default ) setattr ( target , attr , val ) if callback : callback ( val )
register target for changes in the config var named by section and name .