Changeset 3991

Show
Ignore:
Timestamp:
03/23/08 11:23:56 (8 months ago)
Author:
paul
Message:

Added the ability to run BubbletForm? from the command line.

Fixed my changes from the other day to callAfterInterval() to only
save the closure ref when appropriate. My change had the unintended
effect of caching all calls to the same function, no matter what
instance of the class was calling it. Thanks Uwe Grauer for noticing
and reporting this.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/ui/uiwx/__init__.py

    r3987 r3991  
    219219        # Arguments are in the old order 
    220220        interval, func = func, interval 
    221     futureCall = _callAfterIntervalReferences.get((func.func_code, args)) 
     221    func_ref = func 
     222    if func.func_closure: 
     223        func_ref = func.func_code 
     224    futureCall = _callAfterIntervalReferences.get((func_ref, args)) 
    222225    if futureCall: 
    223226        futureCall.Stop() 
    224     _callAfterIntervalReferences[(func.func_code, args)] = wx.FutureCall(interval, func, *args, **kwargs) 
     227    _callAfterIntervalReferences[(func_ref, args)] = wx.FutureCall(interval, func, *args, **kwargs) 
    225228 
    226229 
  • trunk/demo/samples/games/bubblet/BubbletForm.py

    r3816 r3991  
    183183            _("Current score of the game.  (int)")) 
    184184 
     185if __name__ == "__main__": 
     186    dabo.dApp(MainFormClass=BubbletForm).start()