class Color(object): """Wrapper around termcolor to allow colors to be disabled.""" @classmethod def Setup(cls, enabled=True): if enabled: cls.me = cls.WithColor else: cls.me = cls.WithoutColor @classmethod def WithColor(cls, msg, color=None, on_color=None, attrs=None): return termcolor.colored(msg, color, on_color, attrs) @classmethod def WithoutColor(cls, msg, color=None, on_color=None, attrs=None): (color, on_color, attrs) = (color, on_color, attrs) # gpylint return msg
Archives
- September 2011
- April 2011
- March 2011
- February 2011
- January 2011
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- January 2010
- December 2009
- October 2009
- July 2009
- February 2009
- January 2009
- December 2008
- November 2008
- September 2008
- August 2008
- July 2008
- October 2007
- August 2007
- July 2007
- May 2007
- April 2007

0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.