ESC = chr(0x1B)
RESET = "0"
-COLOURS = range(31, 37)
+COLOURS = [str(x) for x in range(31, 37)]
class ColourMap(object):
def __init__(self):
self._cmap = {}
- self._colourIter = itertools.cycle(ANSI_COLOURS)
+ self._colourIter = itertools.cycle(COLOURS)
- def colourFor(string):
+ def colourFor(self, string):
if not self._cmap.has_key(string):
self._cmap[string] = self._colourIter.next()
return self._cmap[string]