ó
'![c           @   sŕ   d  Z  d d l m Z d e f d     YZ d e f d     YZ d e f d     YZ d	 e f d
     YZ d e f d     YZ d e f d     YZ	 d e f d     YZ
 d e f d     YZ d e f d     YZ d S(   sP   Micro reports objects.

A micro report is a tree of layout and content objects.
i˙˙˙˙(   t   string_typest   VNodec           B   sJ   e  Z d d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 RS(   c         C   s   | |  _  d  |  _ g  |  _ d  S(   N(   t   idt   Nonet   parentt   children(   t   selft   nid(    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyt   __init__   s    		c         C   s   t  |  j  S(   N(   t   iterR   (   R   (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyt   __iter__   s    c         C   s   |  j  j |  |  | _ d S(   s   add a node to childrenN(   R   t   appendR   (   R   t   child(    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR      s    c         C   s    |  j  j | |  |  | _ d S(   s   insert a child nodeN(   R   t   insertR   (   R   t   indexR   (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR      s    c         C   s<   y |  j  j d d  SWn t k
 r7 |  j j j   SXd S(   sś   
        return the visit name for the mixed class. When calling 'accept', the
        method <'visit_' + name returned by this method> will be called on the
        visitor
        t   -t   _N(   t   TYPEt   replacet	   Exceptiont	   __class__t   __name__t   lower(   R   (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyt   _get_visit_name#   s    c         O   s)   t  | d |  j    } | |  | |  S(   Ns   visit_%s(   t   getattrR   (   R   t   visitort   argst   kwargst   func(    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyt   accept.   s    c         O   s)   t  | d |  j    } | |  | |  S(   Ns   leave_%s(   R   R   (   R   R   R   R   R   (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyt   leave2   s    N(
   R   t
   __module__R   R   R
   R   R   R   R   R   (    (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR      s   					t
   BaseLayoutc           B   s5   e  Z d  Z d d  Z d   Z d   Z d   Z RS(   sk   base container node

    attributes
    * children : components in this table (i.e. the table's cells)
    c         K   sW   t  t |   j |   x: | D]2 } t | t  rB |  j |  q |  j |  q Wd  S(   N(   t   superR    R   t
   isinstanceR   R   t   add_text(   R   R   R   R   (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR   =   s
    c         C   s,   | |  j    k s t  t j |  |  d S(   s$   overridden to detect problems easilyN(   t   parentst   AssertionErrorR   R   (   R   R   (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR   E   s    c         C   s?   |  j  |  k	 s t  |  j  d k r( g  S|  j  g |  j  j   S(   s   return the ancestor nodesN(   R   R%   R   R$   (   R   (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR$   J   s    c         C   s   |  j  j t |   d S(   s   shortcut to add text dataN(   R   R   t   Text(   R   t   text(    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR#   Q   s    (    (   R   R   t   __doc__R   R   R$   R#   (    (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR    7   s
   		R&   c           B   s   e  Z d  Z e d  Z RS(   sa   a text portion

    attributes :
    * data : the text value as an encoded or unicode string
    c         K   sJ   t  t |   j |   t | t  s4 t | j   | |  _ | |  _ d  S(   N(	   R!   R&   R   R"   R    R%   R   t   escapedt   data(   R   R*   R)   R   (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR   ^   s    	(   R   R   R(   t   TrueR   (    (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR&   X   s   t   VerbatimTextc           B   s   e  Z d  Z RS(   sx   a verbatim text, display the raw data

    attributes :
    * data : the text value as an encoded or unicode string
    (   R   R   R(   (    (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR,   g   s   t   Sectionc           B   s   e  Z d  Z d d d  Z RS(   ső   a section

    attributes :
    * BaseLayout attributes

    a title may also be given to the constructor, it'll be added
    as a first element
    a description may also be given to the constructor, it'll be added
    as a first paragraph
    c         K   sg   t  t |   j |   | r> |  j d t t |  g   n  | rc |  j d t d | f   n  d  S(   Ni    R   (   R!   R-   R   R   t	   ParagraphR&   t   Title(   R   t   titlet   descriptionR   (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR   {   s
    "N(   R   R   R(   R   R   (    (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR-   p   s   
t   EvaluationSectionc           B   s   e  Z d    Z RS(   c         K   sv   t  t |   j |   t   } | j t d t |    |  j |  t   } | j t |   |  j |  d  S(   NR   (   R!   R2   R   R.   R   R&   t   len(   R   t   messageR   R0   t   message_body(    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR      s    		(   R   R   R   (    (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR2      s   R/   c           B   s   e  Z d  Z RS(   st   a title

    attributes :
    * BaseLayout attributes

    A title must not contains a section nor a paragraph!
    (   R   R   R(   (    (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR/      s   R.   c           B   s   e  Z d  Z RS(   sy   a simple text paragraph

    attributes :
    * BaseLayout attributes

    A paragraph must not contains a section !
    (   R   R   R(   (    (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR.      s   t   Tablec           B   s    e  Z d  Z d d d d  Z RS(   s"  some tabular data

    attributes :
    * BaseLayout attributes
    * cols : the number of columns of the table (REQUIRED)
    * rheaders : the first row's elements are table's header
    * cheaders : the first col's elements are table's header
    * title : the table's optional title
    i    c         K   sS   t  t |   j |   t | t  s+ t  | |  _ | |  _ | |  _ | |  _	 d  S(   N(
   R!   R6   R   R"   t   intR%   t   colsR0   t   rheaderst   cheaders(   R   R8   R0   R9   R:   R   (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR   Ž   s    			N(   R   R   R(   R   R   (    (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyR6   ¤   s   	N(   R(   t   sixR    t   objectR   R    R&   R,   R-   R2   R/   R.   R6   (    (    (    s>   lib/python2.7/site-packages/pylint/reporters/ureports/nodes.pyt   <module>	   s   )!	

