comparison cmd2.py @ 411:9d5ff2ddfdea 0.6.2

doc update
author Catherine Devlin <catherine.devlin@gmail.com>
date Tue, 09 Nov 2010 05:22:41 -0500
parents 48ebbdfe9dd4
children f16f444a4d10
comparison
equal deleted inserted replaced
410:48ebbdfe9dd4 411:9d5ff2ddfdea
438 def colorize(self, val, color): 438 def colorize(self, val, color):
439 '''Given a string (``val``), returns that string wrapped in UNIX-style 439 '''Given a string (``val``), returns that string wrapped in UNIX-style
440 special characters that turn on (and then off) text color and style. 440 special characters that turn on (and then off) text color and style.
441 If the ``colors`` environment paramter is ``False``, or the application 441 If the ``colors`` environment paramter is ``False``, or the application
442 is running on Windows, will return ``val`` unchanged. 442 is running on Windows, will return ``val`` unchanged.
443 Available colors/styles: red/blue/green/cyan/magenta, bold, underline''' 443 ``color`` should be one of the supported strings (or styles):
444 red/blue/green/cyan/magenta, bold, underline'''
444 if self.colors and (self.stdout == self.initial_stdout): 445 if self.colors and (self.stdout == self.initial_stdout):
445 return self.colorcodes[color][True] + val + self.colorcodes[color][False] 446 return self.colorcodes[color][True] + val + self.colorcodes[color][False]
446 return val 447 return val
447 448
448 def do_cmdenvironment(self, args): 449 def do_cmdenvironment(self, args):