]>
jfr.im git - z_archive/twitter.git/blob - twitter/ansi.py
2 Support for ANSI colours in command-line client.
11 COLOURS
= [str(x
) for x
in range(31, 37)]
13 class ColourMap(object):
16 self
._colourIter
= itertools
.cycle(COLOURS
)
18 def colourFor(self
, string
):
19 if not self
._cmap
.has_key(string
):
20 self
._cmap
[string
] = self
._colourIter
.next()
21 return self
._cmap
[string
]
26 def cmdColour(colour
):
27 return ESC
+ "[" + colour
+ "m"