grepros 1.3.0
grep for ROS bag files and live topics
Loading...
Searching...
No Matches
ProgressBar Class Reference
Inheritance diagram for ProgressBar:
Inheritance graph

Public Member Functions

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

Public Attributes

 afterargs
 
 aftertemplate
 
 afterword
 
 backchar
 
 bar
 
 daemon
 
 forechar
 
 foreword
 
 interval
 
 is_running
 
 max
 
 min
 
 pause
 
 percent
 
 printbar
 
 progresschar
 
 pulse
 
 pulse_pos
 
 value
 
 width
 

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 527 of file common.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
  max = 100,
  value = 0,
  min = 0,
  width = 30,
  forechar = "-",
  backchar = " ",
  foreword = "",
  afterword = "",
  interval = 1,
  pulse = False,
  aftertemplate = " {afterword}",
**  afterargs 
)
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) and afterargs
@param   afterargs      additional keywords for aftertemplate formatting

Definition at line 537 of file common.py.

Member Function Documentation

◆ draw()

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 630 of file common.py.

◆ run()

run (   self)

Definition at line 643 of file common.py.

◆ stop()

stop (   self)

Definition at line 650 of file common.py.

◆ update()

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

Definition at line 583 of file common.py.

Member Data Documentation

◆ afterargs

afterargs

Definition at line 568 of file common.py.

◆ aftertemplate

aftertemplate

Definition at line 567 of file common.py.

◆ afterword

afterword

Definition at line 564 of file common.py.

◆ backchar

backchar

Definition at line 562 of file common.py.

◆ bar

bar

Definition at line 574 of file common.py.

◆ daemon

daemon

Definition at line 569 of file common.py.

◆ forechar

forechar

Definition at line 561 of file common.py.

◆ foreword

foreword

Definition at line 563 of file common.py.

◆ interval

interval

Definition at line 565 of file common.py.

◆ is_running

is_running

Definition at line 580 of file common.py.

◆ max

max

Definition at line 557 of file common.py.

◆ min

min

Definition at line 559 of file common.py.

◆ pause

pause

Definition at line 572 of file common.py.

◆ percent

percent

Definition at line 570 of file common.py.

◆ printbar

printbar

Definition at line 578 of file common.py.

◆ progresschar

progresschar

Definition at line 579 of file common.py.

◆ pulse

pulse

Definition at line 566 of file common.py.

◆ pulse_pos

pulse_pos

Definition at line 573 of file common.py.

◆ value

value

Definition at line 558 of file common.py.

◆ width

width

Definition at line 560 of file common.py.


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