3
^^              "   @   s,  d Z dRdSdTdUdVdWdXdBZdCdCedD edD edD dEdEdEedF edG dEdEedH dEdEdEdEedH edI edI edI edI edI edI edI edI edI edI dJZdCdCedD edD edD dEdEdEedF edG dEdEdEdEdKZdCdCdCedL dEdCedD edD edD edD dEdEedM edM edF dEdEdEdNZG dOdP dPZdQS )YaG  Functions to generate files readable with Georg Sander's vcg
(Visualization of Compiler Graphs).

You can download vcg at http://rw4.cs.uni-sb.de/~sander/html/gshome.html
Note that vcg exists as a debian package.

See vcg's documentation for explanation about the different values that
maybe used for the functions parameters.
dfstreeminbackwardleft_to_rightright_to_lefttop_to_bottombottom_to_topmaxdepthmaxdepthslowmindepthmindepthslow	mindegreeminindegreeminoutdegree	maxdegreemaxindegreemaxoutdegreeyesnoblackwhiteblueredgreenyellowmagenta	lightgreycyandarkgreydarkbluedarkred	darkgreen
darkyellowdarkmagentadarkcyangold	lightbluelightred
lightgreenlightyellowlightmagenta	lightcyanlilac	turquoise
aquamarinekhakipurpleyellowgreenpinkorangeorchidboxellipserhombtrianglecenterleft_justifyright_justifysolidlinenone
continuousdasheddotted	invisible)algosbooleanscolorsshapes	textmodesarrowstyles
linestyles    rD      rF   rE   rB   rC   )titlelabelcolor	textcolorbordercolorwidthheightborderwidthtextmodeshapeshrinkstretchZorientationvertical_orderhorizontal_orderZxspaceZyspaceZlayoutalgorithmZlate_edge_labelsZdisplay_edge_labelsZdirty_edge_labelsZ
finetuningZmanhattan_edgesZsmanhattan_edgesZport_sharingedgesZnodesZsplines)rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rH   rG   )Z
sourcenameZ
targetnamerL   Z	linestyleclassZ	thicknessrM   rN   Z
arrowcolorZbackarrowcolorZ	arrowsizeZbackarrowsizeZ
arrowstyleZbackarrowstylerS   priorityanchorrX   c               @   sR   e Zd ZdZdd Zdd Zdd Zdd	 ZdddZdd Z	dd Z
dd ZdS )
VCGPrinterzA vcg graph writer.
    c             C   s   || _ d| _d S )N )_stream_indent)selfZoutput_stream rb   ;/tmp/pip-build-8app2_gc/pylint/pylint/pyreverse/vcgutils.py__init__   s    zVCGPrinter.__init__c             K   s,   | j jd| j  | j  | jtf| dS )zopen a vcg graph
        z
%sgraph:{
N)r_   writer`   _inc_indent_write_attributesGRAPH_ATTRS)ra   argsrb   rb   rc   
open_graph   s    zVCGPrinter.open_graphc             C   s   | j   | jjd| j  dS )zclose a vcg graph
        z%s}
N)_dec_indentr_   re   r`   )ra   rb   rb   rc   close_graph   s    zVCGPrinter.close_graphc             K   s4   | j jd| j|f  | jtf| | j jd dS )zdraw a node
        z%snode: {title:"%s"z}
N)r_   re   r`   rg   
NODE_ATTRS)ra   rK   ri   rb   rb   rc   node   s    zVCGPrinter.noder^   c             K   s8   | j jd| j|||f  | jtf| | j jd dS )z-draw an edge from a node to another.
        z*%s%sedge: {sourcename:"%s" targetname:"%s"z}
N)r_   re   r`   rg   
EDGE_ATTRS)ra   Z	from_nodeZto_nodeZ	edge_typeri   rb   rb   rc   edge   s
    zVCGPrinter.edgec             K   s   x|j  D ]\}}y|| }W n( tk
rF   td||j f Y nX |sf| jjd| j||f  q
|dkr| jjd| j|t|f  q
||kr| jjd| j||f  q
td|||f q
W dS )z-write graph, node or edge attributes
        z/no such attribute %s
possible attributes are %sz
%s%s:"%s"
rJ   z%s%s:%s
z=value %s isn't correct for attribute %s
correct values are %sN)itemsKeyError	Exceptionkeysr_   re   r`   int)ra   Zattributes_dictri   keyvalue_typerb   rb   rc   rg      s     zVCGPrinter._write_attributesc             C   s   d| j  | _ dS )zincrement indentation
        z  %sN)r`   )ra   rb   rb   rc   rf      s    zVCGPrinter._inc_indentc             C   s   | j dd | _ dS )zdecrement indentation
        N   )r`   )ra   rb   rb   rc   rk      s    zVCGPrinter._dec_indentN)r^   )__name__
__module____qualname____doc__rd   rj   rl   rn   rp   rg   rf   rk   rb   rb   rb   rc   r]      s   
r]   N)r   r   r   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   )r   r   ) r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   )r4   r5   r6   r7   )r8   r9   r:   )r;   r<   r=   )r>   r?   r@   rA   )r~   Z	ATTRS_VALrh   rm   ro   r]   rb   rb   rb   rc   <module>   s                                                  