Package x2go :: Module utils :: Class ProgressStatus
[frames] | no frames]

type ProgressStatus

source code

object --+
         |
        ProgressStatus

A simple progress status iterator class.

Instance Methods
 
__init__(self, progress_event, progress_func=[0, 10, 20, 30, 40, 50, 60, 70, 80, 90]) source code
 
__iter__(self)
Intialize the ProgressStatus iterator object.
source code
 
next(self)
On each iteration wait for the progress event to get triggered from an outside part of the application.
source code
Method Details

__init__(self, progress_event, progress_func=[0, 10, 20, 30, 40, 50, 60, 70, 80, 90])
(Constructor)

source code 
Parameters:
  • progress_event (obj) - a threading.Event() object that gets notified on progress
  • progress_func (func) - a function that delivers a value between 0 and 100 (progress percentage value)
Overrides: object.__init__

next(self)

source code 

On each iteration wait for the progress event to get triggered from an outside part of the application.

Once the event fires read the progress status from the progress retrieval function and clear the event afterwards (so we wait for the next firing of the event).