X-Git-Url: https://jfr.im/git/z_archive/twitter.git/blobdiff_plain/7522aa11b48b139f47480c96621eb7b6223cacf6..0b9960a363f3d9c8c6fd65eef9cf5879ceed5ca3:/twitter/ansi.py diff --git a/twitter/ansi.py b/twitter/ansi.py index d0233f2..870dec2 100644 --- a/twitter/ansi.py +++ b/twitter/ansi.py @@ -8,14 +8,14 @@ import itertools 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]