pyreporting.progress.ProgressStack#

class ProgressStack[source]#

Bases: object

Used for handling a nested progress bar

ProgressStack holds a stack of nested progress bar statuses, so that for example, if an operation is performed 4 times, the progress bar will not go from 0% to 100% 4 times, but instead go from 0% to 25% for the first operation, etc.

Methods

advance

Increment the current progress value by one step

current_label

Return the label that should be displayed

current_title

Return the title that should be displayed

current_value

Return the global value that should be displayed

is_empty

Return True if the is no progress currently reported

pop

Remove the last nested progress bar from the stack

push

Nest progress reporting.

reset

Remove all nested progress bars

update

Update the values of the current progress bar

class ProgressStackItem(bar_min=0, bar_step=100, label='Please wait', title='', value=None, step=None)[source]#

Bases: object

Stores status for one of a stack of nested progress bars

child_bar_min()[source]#

When creating a nested child progress bar, return the global minimum bar position for this child progress bar

Return type:

int

child_bar_step()[source]#

When creating a nested child progress bar, return the global bar width for this child progress bar

Return type:

int

child_value()[source]#

Return the initial value that a nested child progress bar should take. This is normally zero, but if no parent value was specified it could be None to allow for an unspecified progress value

Return type:

int

global_value()[source]#

Return the progress value as it will appear on the bar, i.e. adjusted to include all the progress nesting

Return type:

int

next_value()[source]#

Return the value that results from incrementing this progress. Generally this is the value plus the step; if no step has been specified or inferred then we assume the next value will be 100%

Return type:

int

advance()[source]#

Increment the current progress value by one step

current_label()[source]#

Return the label that should be displayed

Return type:

str

current_title()[source]#

Return the title that should be displayed

Return type:

str

current_value()[source]#

Return the global value that should be displayed

Return type:

int

is_empty()[source]#

Return True if the is no progress currently reported

Return type:

bool

pop()[source]#

Remove the last nested progress bar from the stack

push()[source]#

Nest progress reporting. After calling this function, subsequent progress updates will modify the progress bar between the current value and the current value plus the last step

reset()[source]#

Remove all nested progress bars

update(value, step, label, title)[source]#

Update the values of the current progress bar

Parameters:
  • value – The progress percentage, or None to display a non-ending progress bar, if supported

  • step – Percentage difference between progress calls.

  • label – The label text to display by the progress

  • title – The title of the progress dialog