fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] String formatting with color functions


From: Ahsan Rabbani
Subject: [Fab-user] String formatting with color functions
Date: Mon, 21 Nov 2011 18:40:52 -0500

I've noticed that when printing strings that are wrapped in color functions it screws up the string formatting. So for example if you have the following code:

def test():
    fmt = "%-20s |"
    print(fmt % "foo bar baz")
    print(fmt % red("foo bar baz"))

The output looks like:

[25164:1858 - 0:488] 06:39:32 address@hidden:o +1] - ~ 
$ fab test
[xargsgrep] Executing task 'test'
foo bar baz          |
foo bar baz |


Does anyone know of a way around this?

Thanks

reply via email to

[Prev in Thread] Current Thread [Next in Thread]