Trees | Indices | Help |
|
---|
|
LongOpStatus provides a way of communicating the status of a long running operations. The intended use is that when a long running operation is about to start it should create an instance of this class and emit it so that any listeners can pick it up and use it to record the status of the operation. Signals ======= op-heartbeat - emitted every 'interval' calls to heartbeat. op-end - emitted once when the operation completes. Example usage: class MyClass(Callback): __signals__ = { 'op-start' : object } def long(self): status = LongOpStatus("doing long job", 100, 10) for i in xrange(0,99): time.sleep(0.1) status.heartbeat() status.end() class MyListener(object): def __init__(self): self._op = MyClass() self._op.connect('op-start', self.start) self._current_op = None def start(self,long_op): self._current_op.connect('op-heartbeat', self.heartbeat) self._current_op.connect('op-end', self.stop) def hearbeat(self): # update status display def stop(self): # close the status display self._current_op = None
Instance Methods | |||
|
|||
|
|||
|
|||
int |
|
||
|
|||
|
|||
bool |
|
||
bool |
|
||
string |
|
||
|
|||
int |
|
||
int |
|
||
Inherited from Inherited from |
Class Methods | |
Inherited from |
Class Variables | |
__signals__ =
|
Properties | |
Inherited from |
Method Details |
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
This should be called for each step in the operation. It will emit a 'op-heartbeat' every 'interval' steps. It recalcuates the 'estimated_secs_to_complete' from the time taken for previous steps. |
Return the number of seconds estimated left before operation completes. This will change as 'hearbeat' is called.
|
End the operation. Causes the 'op-end' signal to be emitted. |
Return true of the user has asked for the operation to be cancelled.
|
|
|
Set the current description message.
|
Get to total number of steps. NOTE: this is not the number of times that the 'op-heartbeat' message will be emited. 'op-heartbeat' is emited get_total_steps/interval times.
|
Get the interval between 'op-hearbeat' signals.
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Mar 9 21:52:58 2008 | http://epydoc.sourceforge.net |