]> jfr.im git - z_archive/twitter.git/blobdiff - twitter/ansi.py
Support for colours in command-line tool.
[z_archive/twitter.git] / twitter / ansi.py
index d0233f28475bef15aeedbe8d76017aaba39e619a..870dec2b5720fe3e98dd20a3adacb328eec7fc54 100644 (file)
@@ -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]