verigak / progress

Easy to use progress bars for Python
ISC License
1.41k stars 179 forks source link

Inappropriate bar labels. #81

Closed AshwinSankar17 closed 4 years ago

AshwinSankar17 commented 4 years ago

Am I doing something wrong here to get "?[K" added to the necessary string?

code :

bar = IncrementalBar('Cleaning text', max=len(links), suffix='%(percent)d%%' )
bar = IncrementalBar('Scraping Links', max=len(paper.articles), suffix='%(percent)d%%')

Output:

?[KScraping Links |████████████████████████████████| 100%
getting content
?[KCleaning text |████████████████████████████████| 100%
scraper_main
?[KScraping Links |████████████████████████████████| 100%
getting content
?[KCleaning text |████████████████████████████████| 100%
scraper_main
?[KScraping Links |████████████████████████████████| 100%
zokai commented 4 years ago

I have the same problem for the Bar. Also Spinner splits the several letters from message and repeats after the spinner. Scanning subfolders... -s...

zhaowb commented 4 years ago

That's 'clearln()' sent esc code to clear line. There is no way to disable that behaviour but the design provided a more generic way to bypass:

from progress.bar import Bar
bar = Bar(clearln=lambda: None)
bar.next()

Here Bar is sample for any other classes. The constructore is to demostrate how to set a dummy clearln function, other parameters are still acceptable.

verigak commented 4 years ago

This issue should be fixed with 12e46ed70209bdc3bb8ca1f0416039883b94e4e1