Releases: darvil82/PBar
Version 2.2.1
Some small tweaks here and there.
- Less memory usage when using multiple bars. Progress bars would not get garbage collected unless
pbar.utils.StdOut.triggers.clear()
was executed. Now using weakrefs. - Improved the
pbar.iter
function to accept multiple bars at once. - Some other small tweaks.
- Added a new example. Right here:
multiple_bars.mp4
Hey, if you are looking for a download page, you can get this from the sites listed here!
Version 2.1.0
This version mostly fixes small bugs from the last version. But also adds a few small things to the Cond class, and adds a property to PBar that should've been there since the start.
- Improved the system that checks for screen scrolling generally.
- A cleared bar should be faster to draw now.
Cond
condition strings can now use ranges with the{start[..step][..end]}
syntax. More information.Cond
now has atimes
property, which specifies the maximum number of times the condition will be checked.- Removed
PBar.prange_from_file()
. Now useless withpbar.iter()
. - Added the
PBar.rtime
property, which returns an aproximated time until the bar reaches 100%. - FormatSets:
- Added 3 new formatset formatting keys,
<rtime>
,<etimef>
and<rtimef>
. These last two will show the time formatted as%M:%S
. - Modified all FormatSets that used
<etime>
to now use<rtime>
. (Because it's more useful) - Added
R_TIME
formatset. Yeah, it just shows the remaining time. - Changed
CLASSIC
formatset toTQDM
:)
- Added 3 new formatset formatting keys,
- The custom stdout controller (
pbar.utils.Stdout
) can be disabled by setting itsenabled
property toFalse
.
Hey, if you are looking for a download page, you can get this from the sites listed here!
Version 2.0.0
Relative Positioning!
Yes, you can now set the position of the bar relative to a point, like the center of the terminal, or even the current position of the cursor! But, there's much more... Here's everything that's new:
- Add the ability to set the progress bar to a relative position from the center of the terminal or the cursor, while applying an offset value that can be negative. For example, the value
("c", "c5")
will position the bar at the center with an offset of 5 characters down. - Terminal screen scrolling will not cause the bar to leave traces of it anymore.
- The bar can now be displayed without it being centered to the middle by setting
bar.centered
toFalse
- Refactor the entirety of pbar to use snake_case instead of camelCase variables. Thanks to the tool camel-snake-pep8.
- The
pbar.bar_helper()
function now accepts a pbar object. It has also been improved generally. - Add
get_pos()
andset_scroll_limit()
topbar.Term
. - Fix
top
content generator being flipped. - Improve
Term.SeqMgr
. - Add
set_title
arg topbar.iter()
. - Added a new example, showcasing the ability to use relative positioning.
relative_pos.mp4
Hey, if you are looking for a download page, you can get this from the sites listed here!
Version 1.16
The highlight of this version is the new flexibility to implement new custom generators for the progress indicator of the bar. New smaller additions and fixes were made too:
- Fixed a lot of typing issues.
- Removed the
config
property ofPBar
. - Added
Term.isSupported()
to check if the terminal is valid. This removes the possible return valueFalse
ofTerm.size()
. - Fixed color conversion not working correctly with some values.
- Changed the name of the property
gfrom
tocontentg
. This property now requires a content generator, which are available in thepbar.ContentGens
class. For example, old:gfrom=pbar.Gfrom.LEFT
, new:contentg=pbar.ContentGens.Left
. - Refactored the entire content generator system (was called gfrom).
- Added 5 new content generators:
- TopLeft
- TopRight
- BottomLeft
- BottomRight
- Center
- Rewrited some of the other generators to be faster to draw.
- The content generator can now be changed with a
Cond
object. - Color values can no longer be
None
.
Please make sure to look at the documentation on the wiki for the content generators if you wish to create your own.
Hey, if you are looking for a download page, you can get this from the sites listed here!
Version 1.15
Version 1.15... And more.
This version adds some new neat features, but most importantly, fixes one error that is been part of PBar since it's first ever version. I am very proud of announcing this. It's not the biggest update ever, but I also wanted to use this patch note as a thank-you note.
I would like to express my love to everyone that starred this project on github, it really means a lot to me, because it shows that this project is considered as something valuable by someone. This helps me continuining this project that started as a small dumb script for... well, another dumb script.
On another note, thanks a lot to the contributors that helped me on this project, and wasted their time trying to improve all of this. These will be listed below.
Patch notes of the latest versions
- The progress bar will no longer exceed the maximun size of the terminal.
- The position and size values will no longer be computed when setting them, instead, they will when the bar draws.
- Added a new
PBar.computedValues
property, which returns the computed values of the bar (position and size).
- Added a new
- Negative values are now supported for the size values. These will set the size of the bar to the space between the bar and the terminal edge (
-1
will stick to the edge). - The bar will be cleared at it's old position each time the bar needs to redraw. This allows it to move to any position, or change it to any size while it's told to draw. This also removes the
PBar._requiresClear
property, which would clear and draw the bar when it's set toTrue
. - Removed the next unnecery settters and getters because it's values don't need to be checked each time we set them.
PBar.text
PBar.position
PBar.size
- Removed unnecesary checks when setting a formatset.
- Fixed position and size process functions (now called
PBar._getComputedPosition
andPBar._getComputedSize
) returning incorrect values. - Fixed bar generators doing unnecesary calculations that are now managed at the size and position functions mentioned before.
- New
taskWrapper
version by @Lunarmagpie (<3), which makes the decorator modify the bytecode of the decorated function, and thus add the new code for progressing the bar (isn't that amazing?). This function is in a experimental state, use at your own risk. - Updated
barHelper
to show more information. - A function can now be supplied to
Cond
. Said function will be called with the PBar object if the condition succeeds. - Conditions are now entirely managed in the
Cond
class, instead of checking and applying at thePBar
object. - Made the graphic generator functions generic, and less of a mess.
- Text at both sides of the bar will no longer clear the entire line of the terminal. Instead, when clearing the bar, only the space taken by the string will be cleared.
- Fixed colors not resetting after drawing the bar on Windows.
- Added the next
Term
objects:SeqMgr
: Context manager for alternating different terminal sequences By default, it changes to a new buffer, moves to the home position, and saves the cursor position.formatStr
: Add format to the string supplied by wrapping text with special characters and sequences.flash
: Flashes the terminal screen.
- FormatSet strings will now be stripped.
- Added the
inverted
property forPBar
, which ifTrue
, the bar will be drawn from the end to the beginning. - Optimized vertical bar rendering.
- If the script that imports pbar is using output redirection or similar, this will no longer crash, but instead run silently without drawing anything on screen.
- Gfrom property now uses values from the
pbar.Gfrom
enum, instead of strings. - Added
PBar.done()
method, which sets the progress bar to 100% and draws it.
Many small changes that I most likely forgot to include.
Apart from the lib...
As some people may have noticed, there's now a webpage which showcases some of the features of PBar. I decided to make this because several reasons, but the most important ones where because I was bored, I had time, and I wanted to make some webpage project (I also had to complete an assigment for completing a webpage, how convenient). Thankfully I could finish the first version of it, send it to my teacher, and then push it to this repository. Continuous changes were made to it, including the ability to change between two more languages than english, spanish and polish (Thanks to @trag1c <3)!
And, well, that's it for now...
Thanks for following this project, and have a nice day!
-- David L. (DarviL82)
Hey, if you are looking for a download page, you can get this from the sites listed here!