adamlamers / prettytable

Python utility for easily creating text-based tables
Other
8 stars 2 forks source link

Bash color #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

Do you think it could be easy to espace bash color codes like that ?

'\033[1;37;40mHello World\033[2;32;40m'

Cause at this time, prettytable count each characters to set column width.

Best regards,
Socketubs.

Original issue reported on code.google.com by geoff...@lehee.name on 26 Oct 2012 at 9:36

GoogleCodeExporter commented 9 years ago
This is a good idea, thanks for making me aware of it.  I will endeavour to get 
this feature in a future version.

Original comment by luke@maurits.id.au on 31 Oct 2012 at 5:58

GoogleCodeExporter commented 9 years ago
Issue 25 has been merged into this issue.

Original comment by luke@maurits.id.au on 17 Feb 2013 at 8:15

GoogleCodeExporter commented 9 years ago
I have made an update in trunk which should solve your problems.  If you have 
time to test it out, that would be great.

Original comment by luke@maurits.id.au on 19 Feb 2013 at 5:36

GoogleCodeExporter commented 9 years ago
Works like a charm!
Thanks luke.

Original comment by geoff...@lehee.name on 19 Feb 2013 at 8:58

GoogleCodeExporter commented 9 years ago
Splendid!  Thanks for testing.  This was actually much easier to sort out than 
I expected, I regret not giving it a shot earlier - it may have made it into 
0.7 if I had!  I have made a few other small improvements lately so I might do 
a 0.7.1 release this coming weekend which will include the colour code support.

Original comment by luke@maurits.id.au on 20 Feb 2013 at 7:44

GoogleCodeExporter commented 9 years ago
It's a great news!

Original comment by geoff...@lehee.name on 20 Feb 2013 at 8:56

GoogleCodeExporter commented 9 years ago
Hi! I have one question related to this issue.

I have to colorize some chars of a string which is into a cell. How can I do 
this?

I've tried this sentence:
table.add_row(["Destination Address", '\033[1;38mpacket1.addr1\033[1;m', 
packet2.addr1])

But it isnt't working.

Thanks in advance!

Original comment by capitan....@gmail.com on 21 Oct 2013 at 12:22