Table of Contents

Class: LongTaskTracer projtls.py

Allow a Tkinter GUI to interrupt a long-lasting computation.

There is one instance-object of this class created by the projtls module, it should not be necessary to make more.

Methods   
__init__
cancelbusytask
checkifcanceled
reset
setidletask
  __init__ 
__init__ ( self,  interval=0.1 )

Constructor.

interval

the minimum interval (in seconds) between GUI update calls.

  cancelbusytask 
cancelbusytask ( self,  but='Abort' )

Abort a long-lasting computation from a GUI button.

(For the singleton instance this is available as "projtls.cancelbusytask")

  checkifcanceled 
checkifcanceled ( self )

Check whether an abort was requested from a GUI button.

Call this routine regularly at safe points in a long calculation (For the singleton instance this is available as "projtls.checkifcanceled")

No value is returned. If the long calculation should be interrupted, a gui.command.GuiCancel exception (subclass of KeyboardInterrupt) is raised.

Exceptions   
command.GuiCancel( "Busy task canceled" )
  reset 
reset ( self )

Reset the cancel request once it has been handled.

  setidletask 
setidletask ( self,  idletask )

Sets the idle task that should be used to try and keep the GUI active. For the singleton instance, this is automatically called by gui.setup.setup()


Table of Contents

This document was automatically generated on Fri Jul 3 09:28:36 2009 by HappyDoc version WORKING