Changeset c0ca0ae for modrana.py


Ignore:
Timestamp:
07/11/11 22:10:25 (3 years ago)
Author:
xkolman2 <xkolman2@…>
Branches:
master
Children:
64f6f21
Parents:
4b9f5e3
git-author:
xkolman2 <xkolman2@…> (07/11/11 22:10:25)
git-committer:
xkolman2 <xkolman2@…> (07/11/11 22:10:25)
Message:

refactoring & documentation update

git-svn-id: https://nlp.fi.muni.cz/svn/gps_navigace/trunk@443 0858a4d0-ffff-46e5-938e-62b5ecb34222

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modrana.py

    rf6b5abf rc0ca0ae  
    235235 
    236236  def watch(self, key, callback, *args): 
    237     """add a callback on an options key""" 
     237    """add a callback on an options key 
     238    callbakc will get: 
     239    key, newValue, oldValue, *args 
     240 
     241    """ 
    238242    nrId = self.maxWatchId + 1 
    239243    id = "%d_%s" % (nrId,key) 
     
    254258      print "modRana: cant remove watch - key does not exist, watchId:", id 
    255259 
    256   def _notifyWatcher(self, key, value): 
     260  def _notifyWatcher(self, key, newValue): 
    257261    """run callbacks registered on an options key""" 
    258262    callbacks = self.watches.get(key, None) 
     
    262266        oldValue = self.get(key, None) 
    263267        if callback: 
    264           callback(key,value,oldValue, *args) 
     268          callback(key,newValue,oldValue, *args) 
    265269        else: 
    266270          print "invalid watcher callback :", callback 
Note: See TracChangeset for help on using the changeset viewer.