;ò
ÎÑAHc           @   sÎ  d  Z  d k Z d k Z y d k Z Wn e j
 o e Z n Xd Z d Z d Z d Z	 d Z
 d Z d Z d	 Z d d >Z d d >Z d d >Z d d >Z d d >Z d d >Z d
 e f d „  ƒ  YZ d „  Z d e f d „  ƒ  YZ y d k Z Wn e j
 o n$ Xd d „ Z e i i e ƒ e ƒ e d „ Z d „  Z d „  Z d e f d „  ƒ  YZ  d e f d „  ƒ  YZ! e! ƒ  Z! d e f d „  ƒ  YZ" e" ƒ  Z" e e j	 op e e e e	 e
 e e e g Z# h  e e i <e e i <e e i <e e i <e e i <e e i <Z$ n e i% d ƒ Z& e i% d ƒ Z' e i% d ƒ Z( e i% d ƒ Z) e i% d ƒ Z* e i% d ƒ Z+ e i% d ƒ Z, e i% d ƒ Z- e i% d ƒ Z. e i% d ƒ Z/ e i% d ƒ Z0 e i% d ƒ Z1 d S(    s‚   
``astyle`` provides classes for adding style (foreground and background color;
bold; blink; etc.) to terminal and curses output.
Ni    i   i   i   i   i   i   i   s   Stylec           B   s  t  Z d  Z d d d f Z h  d e <d e <d e <d e <d e <d	 e	 <d
 e
 <d e <Z h  d e <d e <d e <d e <d e <d e <Z d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z e e ƒ Z d „  Z e e ƒ Z RS(   s]   
    Store foreground color, background color and attribute (bold, underlined
    etc.).
    s   fgs   bgs   attrss   blacks   reds   greens   yellows   blues   magentas   cyans   whites   blinks   bolds   dims   reverses   standouts	   underlinei    c         C   s   | |  _  | |  _ | |  _ d S(   s  
        Create a ``Style`` object with ``fg`` as the foreground color,
        ``bg`` as the background color and ``attrs`` as the attributes.

        Examples:

            >>> Style(COLOR_RED, COLOR_BLACK)
            >>> Style(COLOR_YELLOW, COLOR_BLUE, A_BOLD|A_UNDERLINE)
        N(   s   fgs   selfs   bgs   attrs(   s   selfs   fgs   bgs   attrs(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   __init__:   s    	 		c         G   sV   t  ƒ  } xB | D]: } t | t  ƒ o | i | ƒ q | i |  | f ƒ q W| Sd  S(   N(   s   Texts   texts   argss   args
   isinstances   extends   appends   self(   s   selfs   argss   texts   arg(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   __call__H   s    	 c         C   s:   |  i | i j o# |  i | i j o |  i | i j Sd  S(   N(   s   selfs   fgs   others   bgs   attrs(   s   selfs   other(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   __eq__Q   s    c         C   s:   |  i | i j p# |  i | i j p |  i | i j Sd  S(   N(   s   selfs   fgs   others   bgs   attrs(   s   selfs   other(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   __neq__T   s    c      
   C   s³   d d d d d d d d f } d	 d
 d d d d f } d |  i i | |  i | |  i d i g  i } t
 d ƒ D]* } |  i d | >@o | | | ƒ qp qp ~ ƒ p d f Sd  S(   Ns   blacks   reds   greens   yellows   blues   magentas   cyans   whites   blinks   bolds   dims   reverses   standouts	   underlines   <%s fg=%s bg=%s attrs=%s>s   |i   i   i    (   s
   color2names
   attrs2names   selfs	   __class__s   __name__s   fgs   bgs   joins   appends   _[1]s   xranges   bs   attrs(   s   selfs   bs   _[1]s
   attrs2names
   color2name(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   __repr__W   s    c         C   sÝ   t  } t } d } | i d ƒ } t | ƒ d j o• |  i
 | d i ƒ  } t | ƒ d j og |  i
 | d i ƒ  } t | ƒ d j o9 x6 | d i d ƒ D] } | |  i | i ƒ  O} qœ WqÅ qÉ n |  | | | ƒ Sd S(   sz   
        Create a ``Style`` object from a string. The format looks like this:
        ``"red:black:bold|blink"``.
        i    s   :i   i   s   |N(   s   COLOR_WHITEs   fgs   COLOR_BLACKs   bgs   attrss   values   splits   partss   lens   clss
   COLORNAMESs   lowers   strattrs	   ATTRNAMES(   s   clss   values   bgs   strattrs   partss   attrss   fg(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   fromstr_   s      'c         C   s    |  i t i i | | ƒ ƒ Sd S(   s—   
        Create a ``Style`` from an environment variable named ``name``
        (using ``default`` if the environment variable doesn't exist).
        N(   s   clss   fromstrs   oss   environs   gets   names   default(   s   clss   names   default(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   fromenvt   s     (   s   __name__s
   __module__s   __doc__s	   __slots__s   COLOR_BLACKs	   COLOR_REDs   COLOR_GREENs   COLOR_YELLOWs
   COLOR_BLUEs   COLOR_MAGENTAs
   COLOR_CYANs   COLOR_WHITEs
   COLORNAMESs   A_BLINKs   A_BOLDs   A_DIMs	   A_REVERSEs
   A_STANDOUTs   A_UNDERLINEs	   ATTRNAMESs   __init__s   __call__s   __eq__s   __neq__s   __repr__s   fromstrs   classmethods   fromenv(    (    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   Style    s    N
<								c         C   s“  t  t Bt Bt B} |  i | @} | i | @} g  } |  | j oL| | @p
 | t j o | i d ƒ t }  d } n | t @o | t @o | i d ƒ n | t @o | t @o | i d ƒ n | t  @o | t  @o | i d ƒ n | t @o | t @o | i d ƒ n |  i | i j o | i d | i ƒ n |  i | i j o | i d | i ƒ n | o d	 d
 i | ƒ Sq‹n d Sd S(   sa   
    Return the ANSI escape sequence needed to switch from style ``s1`` to
    style ``s2``.
    s   0i    s   1s   4s   5s   7s   3%ds   4%ds   [%sms   ;s    N(   s   A_BLINKs   A_BOLDs   A_UNDERLINEs	   A_REVERSEs   attrmasks   s1s   attrss   a1s   s2s   a2s   argss   style_defaults   appends   fgs   bgs   join(   s   s1s   s2s   argss   a1s   a2s   attrmask(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   switchstyle}   s2     
s   Textc           B   sq   t  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e	 d „ Z
 e	 d „ Z d	 „  Z e	 d
 „ Z RS(   sw   
    A colored string. A ``Text`` object is a sequence, the sequence
    items will be ``(style, string)`` tuples.
    c         G   s   t  i |  ƒ |  i | Œ  d  S(   N(   s   lists   __init__s   selfs   appends   args(   s   selfs   args(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   __init__¶   s    c         C   s1   d |  i i |  i i t i |  ƒ d d !f Sd  S(   Ns	   %s.%s(%s)i   iÿÿÿÿ(   s   selfs	   __class__s
   __module__s   __name__s   lists   __repr__(   s   self(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   __repr__º   s    c         G   s    x™ | D]‘ } t | t ƒ o |  i | ƒ q t | t ƒ o t i |  | ƒ q t | t	 ƒ o t i |  t
 | f ƒ q t i |  t
 t | ƒ f ƒ q Wd  S(   N(   s   argss   args
   isinstances   Texts   selfs   extends   tuples   lists   appends   unicodes   style_defaults   str(   s   selfs   argss   arg(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   append¿   s     c         G   s   t  | Œ  |  | | +d  S(   N(   s   Texts   argss   selfs   index(   s   selfs   indexs   args(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   insertÊ   s    c         C   s+   t  ƒ  } | i |  ƒ | i | ƒ | Sd  S(   N(   s   Texts   news   appends   selfs   other(   s   selfs   others   new(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   __add__Í   s    	c         C   s   |  i | ƒ |  Sd  S(   N(   s   selfs   appends   other(   s   selfs   other(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   __iadd__Ó   s    c         c   sÎ   | o t } xb |  D]Z \ } } t | t t f ƒ o7 t	 | | ƒ } | o | Vn | o | Vn | } q q Wt	 | t ƒ } | o | VqÊ n7 x3 |  D]+ \ } } t | t t f ƒ o | Vq› q› Wd S(   si   
        This generator yields the strings that will make up the final
        colorized string.
        N(   s   styleds   style_defaults   oldstyles   selfs   styles   strings
   isinstances   ints   longs   switchstyles   switch(   s   selfs   styleds   styles   strings   switchs   oldstyle(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   format×   s&       c         C   s   d i  |  i | ƒ ƒ Sd S(   se   
        Return the resulting string (with escape sequences, if ``styled``
        is true).
        s    N(   s   joins   selfs   formats   styled(   s   selfs   styled(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   stringî   s     c         C   s   |  i t ƒ Sd S(   sN   
        Return ``self`` as a string (without ANSI escape sequences).
        N(   s   selfs   strings   False(   s   self(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   __str__õ   s     c         C   s+   x$ |  i | ƒ D] } | i | ƒ q Wd S(   sx   
        Write ``self`` to the output stream ``stream`` (with escape sequences,
        if ``styled`` is true).
        N(   s   selfs   formats   styleds   parts   streams   write(   s   selfs   streams   styleds   part(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   writeû   s      (   s   __name__s
   __module__s   __doc__s   __init__s   __repr__s   appends   inserts   __add__s   __iadd__s   Trues   formats   strings   __str__s   write(    (    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   Text°   s    							s   defaultc         c   s#   d t  f Vx |  D]
 } | Vq Wd  S(   Niÿÿÿÿ(   s   Trues   selfs   info(   s   selfs   modes   info(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   xrepr_astyle_text	  s    
 c         C   si   | t j oT y t i |  i ƒ  ƒ } Wqa t t f j
 o
 ‚  qa t j
 o t	 } qa Xn | Sd S(   s-  
    If ``styled`` is ``None``, return whether ``stream`` refers to a terminal.
    If this can't be determined (either because ``stream`` doesn't refer to a
    real OS file, or because you're on Windows) return ``False``. If ``styled``
    is not ``None`` ``styled`` will be returned unchanged.
    N(
   s   styleds   Nones   oss   isattys   streams   filenos   KeyboardInterrupts
   SystemExits	   Exceptions   False(   s   streams   styled(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   streamstyle  s     c         G   s)   t  | Œ  } | i |  t |  | ƒ ƒ d S(   s(   
    Write ``texts`` to ``stream``.
    N(   s   Texts   textss   texts   writes   streams   streamstyles   styled(   s   streams   styleds   textss   text(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   write!  s     c         G   s!   t  |  | | Œ |  i  d ƒ d S(   sD   
    Write ``texts`` to ``stream`` and finish with a line feed.
    s   
N(   s   writes   streams   styleds   texts(   s   streams   styleds   texts(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   writeln)  s     s   Streamc           B   s5   t  Z d  Z e d „ Z d „  Z d „  Z d „  Z RS(   s0   
    Stream wrapper that adds color output.
    c         C   s   | |  _  t | | ƒ |  _ d  S(   N(   s   streams   selfs   streamstyles   styled(   s   selfs   streams   styled(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   __init__5  s    	c         G   s   t  |  i |  i | Œ d  S(   N(   s   writes   selfs   streams   styleds   texts(   s   selfs   texts(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   write9  s    c         G   s   t  |  i |  i | Œ d  S(   N(   s   writelns   selfs   streams   styleds   texts(   s   selfs   texts(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   writeln<  s    c         C   s   t  |  i | ƒ Sd  S(   N(   s   getattrs   selfs   streams   name(   s   selfs   name(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   __getattr__?  s    (   s   __name__s
   __module__s   __doc__s   Nones   __init__s   writes   writelns   __getattr__(    (    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   Stream1  s
    		s   stdoutc           B   s)   t  Z d  Z d „  Z d „  Z d „  Z RS(   sC   
    Stream wrapper for ``sys.stdout`` that adds color output.
    c         G   s   t  t i t | Œ d  S(   N(   s   writes   syss   stdouts   Nones   texts(   s   selfs   texts(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   writeG  s    c         G   s   t  t i t | Œ d  S(   N(   s   writelns   syss   stdouts   Nones   texts(   s   selfs   texts(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   writelnJ  s    c         C   s   t  t i | ƒ Sd  S(   N(   s   getattrs   syss   stdouts   name(   s   selfs   name(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   __getattr__M  s    (   s   __name__s
   __module__s   __doc__s   writes   writelns   __getattr__(    (    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   stdoutC  s    		s   stderrc           B   s)   t  Z d  Z d „  Z d „  Z d „  Z RS(   sC   
    Stream wrapper for ``sys.stderr`` that adds color output.
    c         G   s   t  t i t | Œ d  S(   N(   s   writes   syss   stderrs   Nones   texts(   s   selfs   texts(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   writeV  s    c         G   s   t  t i t | Œ d  S(   N(   s   writelns   syss   stderrs   Nones   texts(   s   selfs   texts(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   writelnY  s    c         C   s   t  t i | ƒ Sd  S(   N(   s   getattrs   syss   stdouts   name(   s   selfs   name(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   __getattr__\  s    (   s   __name__s
   __module__s   __doc__s   writes   writelns   __getattr__(    (    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   stderrR  s    		s   white:blacks   magenta:blacks   yellow:blacks
   cyan:blacks   green:blacks	   red:black(2   s   __doc__s   syss   oss   cursess   ImportErrors   Nones   COLOR_BLACKs	   COLOR_REDs   COLOR_GREENs   COLOR_YELLOWs
   COLOR_BLUEs   COLOR_MAGENTAs
   COLOR_CYANs   COLOR_WHITEs   A_BLINKs   A_BOLDs   A_DIMs	   A_REVERSEs
   A_STANDOUTs   A_UNDERLINEs   objects   Styles   switchstyles   lists   Texts   ipipes   xrepr_astyle_texts   xreprs	   when_types   streamstyles   writes   writelns   Streams   stdouts   stderrs   COLOR2CURSESs   A2CURSESs   fromstrs   style_defaults   style_type_nones   style_type_bools   style_type_numbers   style_type_datetimes   style_type_types	   style_urls	   style_dirs
   style_files   style_ellisiss   style_errors   style_nodata(*   s   Styles   cursess   COLOR_YELLOWs   COLOR_GREENs	   style_dirs   xrepr_astyle_texts   style_ellisiss   style_nodatas   streamstyles   writelns   A_DIMs   style_type_datetimes   COLOR_MAGENTAs	   style_urls   stdouts	   COLOR_REDs   style_errors   writes   style_type_nones   COLOR_BLACKs   A_BLINKs   A_UNDERLINEs
   style_files   style_type_types
   COLOR_CYANs   A2CURSESs   A_BOLDs   syss
   A_STANDOUTs   style_type_numbers   ipipes   style_defaults   switchstyles   style_type_bools   Streams
   COLOR_BLUEs   Texts   COLOR_WHITEs	   A_REVERSEs   COLOR2CURSESs   stderrs   os(    (    sJ   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/astyle.pys   ?   sf   





]	3T				R