[Ml-yokadi] renderTaskListRow is buggy
Sébastien Renard
Sebastien.Renard
Mer 18 Fév 09:01:28 CET 2009
Hello,
Our text renderTaskListRow is buggy. Formating relies on string length
(%(foo)-10s) but once we use colors it works bad. Because string length is
modified by ANSI colors code ! So colored word is "longer" (as a string, not
for ours eyes) and cause bad formating
I used a hack for urgency because colored numbers are always two digits (see
the ugly +" " I put on oline 66 and 68). And timeleft was the last field...
But as I was changing date creation to display task age, I just discover again
that forgotten bug...
Using python string fomrating is quite confortable and easy, but the only way
I see to keep this is either :
- put color after padding formating
- give fake size (removing extra ANSI colors code size)
An other solution would be to write our own formating/padding function.
What do you prefer ? Or do you see another way to do it better ?
--
Sébastien
Plus d'informations sur la liste de diffusion Ml-yokadi