Public Member Functions | Public Attributes | List of all members
grepros.common.ProgressBar Class Reference
Inheritance diagram for grepros.common.ProgressBar:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, max=100, value=0, min=0, width=30, forechar="-", backchar=" ", foreword="", afterword="", interval=1, pulse=False, aftertemplate=" {afterword}")
 
def draw (self, flush=False)
 
def run (self)
 
def stop (self)
 
def update (self, value=None, draw=True, flush=False)
 

Public Attributes

 bar
 
 daemon
 
 is_running
 
 pause
 
 percent
 
 printbar
 
 progresschar
 
 pulse_pos
 
 value
 

Detailed Description

A simple ASCII progress bar with a ticker thread

Drawn like
'[---------/   36%            ] Progressing text..'.
or for pulse mode
'[    ----                    ] Progressing text..'.

Definition at line 348 of file common.py.

Constructor & Destructor Documentation

◆ __init__()

def grepros.common.ProgressBar.__init__ (   self,
  max = 100,
  value = 0,
  min = 0,
  width = 30,
  forechar = "-",
  backchar = " ",
  foreword = "",
  afterword = "",
  interval = 1,
  pulse = False,
  aftertemplate = " {afterword}" 
)
Creates a new progress bar, without drawing it yet.

@param   max            progress bar maximum value, 100%
@param   value          progress bar initial value
@param   min            progress bar minimum value, for 0%
@param   width          progress bar width (in characters)
@param   forechar       character used for filling the progress bar
@param   backchar       character used for filling the background
@param   foreword       text in front of progress bar
@param   afterword      text after progress bar
@param   interval       ticker thread interval, in seconds
@param   pulse          ignore value-min-max, use constant pulse instead
@param   aftertemplate  afterword format() template, populated with vars(self)

Definition at line 358 of file common.py.

Member Function Documentation

◆ draw()

def grepros.common.ProgressBar.draw (   self,
  flush = False 
)
Prints the progress bar, from the beginning of the current line.

@param   flush  add linefeed to end, forcing a new line for any next print

Definition at line 438 of file common.py.

◆ run()

def grepros.common.ProgressBar.run (   self)

Definition at line 451 of file common.py.

◆ stop()

def grepros.common.ProgressBar.stop (   self)

Definition at line 458 of file common.py.

◆ update()

def grepros.common.ProgressBar.update (   self,
  value = None,
  draw = True,
  flush = False 
)
Updates the progress bar value, and refreshes by default; returns self.

Definition at line 393 of file common.py.

Member Data Documentation

◆ bar

grepros.common.ProgressBar.bar

Definition at line 382 of file common.py.

◆ daemon

grepros.common.ProgressBar.daemon

Definition at line 377 of file common.py.

◆ is_running

grepros.common.ProgressBar.is_running

Definition at line 388 of file common.py.

◆ pause

grepros.common.ProgressBar.pause

Definition at line 380 of file common.py.

◆ percent

grepros.common.ProgressBar.percent

Definition at line 378 of file common.py.

◆ printbar

grepros.common.ProgressBar.printbar

Definition at line 386 of file common.py.

◆ progresschar

grepros.common.ProgressBar.progresschar

Definition at line 387 of file common.py.

◆ pulse_pos

grepros.common.ProgressBar.pulse_pos

Definition at line 381 of file common.py.

◆ value

grepros.common.ProgressBar.value

Definition at line 379 of file common.py.


The documentation for this class was generated from the following file:


grepros
Author(s): Erki Suurjaak
autogenerated on Sat Jan 6 2024 03:11:30