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

Class 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])
x.__init__(...) initializes x; see help(type(x)) for signature
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

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

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

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

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).