Exemple #1
0
 def __call__(self, result, options):
     colour = self._colourMap.colourFor(result['from_user'])
     return (
         u"%s%s%s%s %s" %
         (get_time_string(result, options, "%a, %d %b %Y %H:%M:%S +0000"),
          ansi.cmdColour(colour), result['from_user'], ansi.cmdReset(),
          result['text']))
Exemple #2
0
 def render_prompt(self, prompt):
     '''Parses the `prompt` string and returns the rendered version'''
     prompt = prompt.strip("'").replace("\\'","'")
     for colour in ansi.COLOURS_NAMED:
         if '[%s]' %(colour) in prompt:
             prompt = prompt.replace(
                 '[%s]' %(colour), ansi.cmdColourNamed(colour))
     prompt = prompt.replace('[R]', ansi.cmdReset())
     return prompt
Exemple #3
0
 def render_prompt(self, prompt):
     '''Parses the `prompt` string and returns the rendered version'''
     prompt = prompt.strip("'").replace("\\'", "'")
     for colour in ansi.COLOURS_NAMED:
         if '[%s]' % (colour) in prompt:
             prompt = prompt.replace('[%s]' % (colour),
                                     ansi.cmdColourNamed(colour))
     prompt = prompt.replace('[R]', ansi.cmdReset())
     return prompt
Exemple #4
0
 def __call__(self, result, options):
     colour = self._colourMap.colourFor(result['from_user'])
     return (u"%s%s%s%s %s" %(
         get_time_string(result, options, "%a, %d %b %Y %H:%M:%S +0000"),
         ansi.cmdColour(colour), result['from_user'],
         ansi.cmdReset(), result['text']))
Exemple #5
0
 def __call__(self, status, options):
     colour = self._colourMap.colourFor(status['user']['screen_name'])
     return (u"%s%s%s%s %s" %(
         get_time_string(status, options),
         ansi.cmdColour(colour), status['user']['screen_name'],
         ansi.cmdReset(), status['text']))
Exemple #6
0
 def __call__(self, list):
     colour = self._colourMap.colourFor(list['name'])
     return (u"%s%-15s%s %s" %(
         ansi.cmdColour(colour), list['name'],
         ansi.cmdReset(), list['description']))
Exemple #7
0
 def __call__(self, list):
     colour = self._colourMap.colourFor(list['name'])
     return (u"%s%-15s%s %s" % (ansi.cmdColour(colour), list['name'],
                                ansi.cmdReset(), list['description']))
Exemple #8
0
 def __call__(self, status, options):
     colour = self._colourMap.colourFor(status['user']['screen_name'])
     return (
         u"%s%s%s%s %s" %
         (get_time_string(status, options), ansi.cmdColour(colour),
          status['user']['screen_name'], ansi.cmdReset(), status['text']))