Skip to content

Releases: darvil82/PBar

Version 2.2.1

28 Apr 18:53
Compare
Choose a tag to compare

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

18 Jan 02:42
Compare
Choose a tag to compare

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 a times property, which specifies the maximum number of times the condition will be checked.
  • Removed PBar.prange_from_file(). Now useless with pbar.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 to TQDM :)
  • The custom stdout controller (pbar.utils.Stdout) can be disabled by setting its enabled property to False.

Hey, if you are looking for a download page, you can get this from the sites listed here!

Version 2.0.0

09 Jan 19:35
Compare
Choose a tag to compare

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 to False
  • 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() and set_scroll_limit() to pbar.Term.
  • Fix top content generator being flipped.
  • Improve Term.SeqMgr.
  • Add set_title arg to pbar.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

16 Dec 02:31
Compare
Choose a tag to compare

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:

  1. Fixed a lot of typing issues.
  2. Removed the config property of PBar.
  3. Added Term.isSupported() to check if the terminal is valid. This removes the possible return value False of Term.size().
  4. Fixed color conversion not working correctly with some values.
  5. Changed the name of the property gfrom to contentg. This property now requires a content generator, which are available in the pbar.ContentGens class. For example, old: gfrom=pbar.Gfrom.LEFT, new: contentg=pbar.ContentGens.Left.
  6. Refactored the entire content generator system (was called gfrom).
  7. Added 5 new content generators:
    • TopLeft
    • TopRight
    • BottomLeft
    • BottomRight
    • Center
  8. Rewrited some of the other generators to be faster to draw.
  9. The content generator can now be changed with a Cond object.
  10. 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

09 Dec 18:47
Compare
Choose a tag to compare

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

  1. The progress bar will no longer exceed the maximun size of the terminal.
  2. 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).
  3. 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).
  4. 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 to True.
  5. 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
  6. Removed unnecesary checks when setting a formatset.
  7. Fixed position and size process functions (now called PBar._getComputedPosition and PBar._getComputedSize) returning incorrect values.
  8. Fixed bar generators doing unnecesary calculations that are now managed at the size and position functions mentioned before.
  9. 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.
  10. Updated barHelper to show more information.
  11. A function can now be supplied to Cond. Said function will be called with the PBar object if the condition succeeds.
  12. Conditions are now entirely managed in the Cond class, instead of checking and applying at the PBar object.
  13. Made the graphic generator functions generic, and less of a mess.
  14. 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.
  15. Fixed colors not resetting after drawing the bar on Windows.
  16. Added the next Term objects:
    1. 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.
    2. formatStr: Add format to the string supplied by wrapping text with special characters and sequences.
    3. flash: Flashes the terminal screen.
  17. FormatSet strings will now be stripped.
  18. Added the inverted property for PBar, which if True, the bar will be drawn from the end to the beginning.
  19. Optimized vertical bar rendering.
  20. 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.
  21. Gfrom property now uses values from the pbar.Gfrom enum, instead of strings.
  22. 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!