sjmikler / progress-table

Display progress as a pretty table in the command line.
MIT License
98 stars 3 forks source link

cell_color property is lost after adding a new row #32

Closed touste closed 1 month ago

touste commented 2 months ago

When using the cell_color option in update, then adding a new row, the color is reset to white (only the last row has the correct colors).

I can force the correct behaviour by using add_row(color=table._data_rows[-1].COLORS) but this throws an error if cell_color was something like "bold green".

from progress_table import ProgressTable

table = ProgressTable()
table.add_column("Value")

for i in range(10):
    table.add_row()
    table.update("Value", i, cell_color="red")

image

sjmikler commented 2 months ago

Hey, thanks for catching this. I plan to try reproducing and fixing this in a few days from now.

sjmikler commented 2 months ago

This should be fixed in #33 and in the newly released version 2.2.5.

Now the cell_color has the priority and will override the general row and column settings. Let me know if that solves it for you.

touste commented 1 month ago

I confirm the issue is fixed in the new version, thanks!

On Tue, Sep 10, 2024 at 10:29 PM Szymon Mikler @.***> wrote:

This should be fixed in #33 https://github.com/sjmikler/progress-table/pull/33 and in the newly released version 2.2.5.

Now the cell_color has the priority and will override the general row and column settings. Let me know if that solves it for you.

— Reply to this email directly, view it on GitHub https://github.com/sjmikler/progress-table/issues/32#issuecomment-2341954802, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWLXEANZDDAXPFWSVSBS2TZV5JENAVCNFSM6AAAAABNURNO3SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBRHE2TIOBQGI . You are receiving this because you authored the thread.Message ID: @.***>