Package mrv :: Module interface :: Class iProgressIndicator
[hide private]
[frames] | no frames]

Class iProgressIndicator

source code

object --+    
         |    
 Interface --+
             |
            iProgressIndicator

Interface allowing to submit progress information The default implementation just prints the respective messages Additionally you may query whether the computation has been cancelled by the user

Note: this interface is a simple progress indicator itself, and can do some computations for you if you use the get() method yourself

Instance Methods [hide private]

Inherited from Interface: supports

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

    Initialization
 
__init__(self, min=0, max=100, is_relative=True, may_abort=False, round_robin=False, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
begin(self)
intiialize the progress indicator before calling set
source code
 
end(self)
indicate that you are done with the progress indicator - this must be your last call to the interface
source code
    Edit
 
refresh(self, message=None)
Refresh the progress indicator so that it represents its values on screen.
source code
 
set(self, value, message=None, omit_refresh=False)
Set the progress of the progress indicator to the given value
source code
 
setRange(self, min, max)
set the range within we expect our progress to occour
source code
 
setRoundRobin(self, round_robin)
Set if round-robin mode should be used.
source code
 
setRelative(self, state)
enable or disable relative progress computations
source code
 
setAbortable(self, state)
If state is True, the progress may be interrupted, if false it cannot be interrupted
source code
 
setup(self, range=None, relative=None, abortable=None, begin=True, round_robin=None)
Multifunctional, all in one convenience method setting all important attributes at once.
source code
    Query
 
get(self)
Returns: the current progress value
source code
 
value(self)
Returns: current progress as it is stored internally, without regarding the range or round-robin options.
source code
 
range(self)
Returns: tuple( min, max ) value
source code
 
roundRobin(self)
Returns: True if roundRobin mode is enabled
source code
 
prefix(self, value)
Returns: a prefix indicating the progress according to the current range and given value
source code
 
isAbortable(self)
Returns: True if the process may be cancelled
source code
 
isRelative(self)
Returns: true if internal progress computations are relative, False if they are treated as absolute values
source code
 
isCancelRequested(self)
Returns: true if the operation should be aborted
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, min=0, max=100, is_relative=True, may_abort=False, round_robin=False, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • min - the minimum progress value
  • max - the maximum progress value
  • is_relative - if True, the values given will be scaled to a range of 0-100, if False no adjustments will be done
  • round_robin - see setRoundRobin
  • kwargs - additional arguments being ignored
Overrides: object.__init__

refresh(self, message=None)

source code 
Refresh the progress indicator so that it represents its values on screen.
Parameters:
  • message - message passed along by the user

set(self, value, message=None, omit_refresh=False)

source code 
Set the progress of the progress indicator to the given value
Parameters:
  • value - progress value ( min<=value<=max )
  • message - optional message you would like to give to the user
  • omit_refresh - by default, the progress indicator refreshes on set, if False, you have to call refresh manually after you set the value

setRoundRobin(self, round_robin)

source code 
Set if round-robin mode should be used. If True, values exceeding the maximum range will be wrapped and start at the minimum range

setup(self, range=None, relative=None, abortable=None, begin=True, round_robin=None)

source code 
Multifunctional, all in one convenience method setting all important attributes at once. This allows setting up the progress indicator with one call instead of many
Parameters:
  • range - Tuple( min, max ) - start ane end of progress indicator range
  • relative - equivalent to setRelative
  • abortable - equivalent to setAbortable
  • round_robin - equivalent to setRoundRobin
  • begin - if True, begin will be called as well

Note: If a kw argument is None, it will not be set

get(self)

source code 
Returns:
the current progress value

Note: if set to relative mode, values will range from 0.0 to 100.0. Values will always be within the ones returned by range

value(self)

source code 
Returns:
current progress as it is stored internally, without regarding the range or round-robin options.

Note: This allows you to use this instance as a counter without concern to the range and round-robin settings

range(self)

source code 
Returns:
tuple( min, max ) value

roundRobin(self)

source code 
Returns:
True if roundRobin mode is enabled

prefix(self, value)

source code 
Returns:
a prefix indicating the progress according to the current range and given value

isAbortable(self)

source code 
Returns:
True if the process may be cancelled

isRelative(self)

source code 
Returns:
true if internal progress computations are relative, False if they are treated as absolute values

isCancelRequested(self)

source code 
Returns:
true if the operation should be aborted