ó
å9Nc           @  s}  d  Z  d d l m Z d d l Z d d g Z dM Z e e e d d	 d
 d d d
 d d g e e	 d d      Z
 e
 d
 =e e e d d d d d d d d g e e	 d d      Z e e e d d d d d d d  d! g e e	 d" d#      Z d$ Z d d d d%  Z d d d d&  Z e d' k rye d( e j d)   e d*  e d+ d  e d, d  e d- d  e d. d  e d/ d  e d0 d  e d1 d   e d2 d!  e d3 d4  e d5  e d6 d7 d e d8 d7 d e d9 d7 d e d: d7 d e d; d7 d e d< d7 d e d= d7 d e d> d? d d7 d e d3 d4  e d@  e dA d dB d g e dC d dB d	 g e dD d dB d g e dE d dB d g e dF d dB d g e dG d dB d g e dH d  dB d d d g e dI d! dB d	 d d g e d3 d4  e dJ  e dK d d d g  e dL d d d g  n  d S(N   s.   ANSII Color formatting for output in terminal.iĸĸĸĸ(   t   print_functionNt   coloredt   cprinti   i    t   boldt   darkt    t	   underlinet   blinkt   reverset	   concealedi	   t   on_greyt   on_redt   on_greent	   on_yellowt   on_bluet
   on_magentat   on_cyant   on_whitei(   i0   t   greyt   redt   greent   yellowt   bluet   magentat   cyant   whitei   i&   s   [0mc         C  sĶ   t  j d  d k rĒ d } | d k	 r> | t | |  f }  n  | d k	 ra | t | |  f }  n  | d k	 r x% | D] } | t | |  f }  qt Wn  |  t 7}  n  |  S(   s§  Colorize text.

    Available text colors:
        red, green, yellow, blue, magenta, cyan, white.

    Available text highlights:
        on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, on_white.

    Available attributes:
        bold, dark, underline, blink, reverse, concealed.

    Example:
        colored('Hello, World!', 'red', 'on_grey', ['blue', 'blink'])
        colored('Hello, World!', 'green')
    t   ANSI_COLORS_DISABLEDs   [%dm%sN(   t   ost   getenvt   Nonet   COLORSt
   HIGHLIGHTSt
   ATTRIBUTESt   RESET(   t   textt   colort   on_colort   attrst   fmt_strt   attr(    (    s2   /srv/kernel/kteam-tools/dashboard/ktl/termcolor.pyR   V   s    c         K  s    t  t |  | | |  |  d S(   sF   Print colorize text.

    It accepts arguments of print function.
    N(   t   printR   (   R"   R#   R$   R%   t   kwargs(    (    s2   /srv/kernel/kteam-tools/dashboard/ktl/termcolor.pyR   v   s    t   __main__s   Current terminal type: %st   TERMs   Test basic colors:s
   Grey colors	   Red colors   Green colors   Yellow colors
   Blue colors   Magenta colors
   Cyan colors   White colort   -iN   s   Test highlights:s   On grey colorR$   s   On red colors   On green colors   On yellow colors   On blue colors   On magenta colors   On cyan colors   On white colorR#   s   Test attributes:s   Bold grey colorR%   s   Dark red colors   Underline green colors   Blink yellow colors   Reversed blue colors   Concealed Magenta colors!   Bold underline reverse cyan colors    Dark blink concealed white colors   Test mixing:s   Underline red on grey colors   Reversed green on red color(   i   i   i    (   t   __doc__t
   __future__R    R   t   __ALL__t   VERSIONt   dictt   listt   zipt   rangeR    R   R   R!   R   R   R   t   __name__R(   R   (    (    (    s2   /srv/kernel/kteam-tools/dashboard/ktl/termcolor.pyt   <module>   s    	




