o
    ýÑÐb  ã                   @   s¼  d Z ddddddddœZi d	d
“dd
“ded “ded “ded “dd“dd“dd“ded “ded “dd“dd“ded “dd“dd“dd“dd“ed ed  ed  ed  ed  ed  ed  ed  ed  ed  ed  d!œ¥Zd
d
ed ed ed ddded ed ddddd"œZi d#d
“d$d
“dd
“d%ed& “d'd“d(d
“ded “ded “d)ed “d*ed “d+d“d,d“d-ed. “d/ed. “ded “d0d“d1d“ddi¥ZG d2d3„ d3ƒZd4S )5aG  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ÚtreeZminbackwardZleft_to_rightÚright_to_leftZtop_to_bottomZbottom_to_topZmaxdepthZmaxdepthslowZmindepthZmindepthslowZ	mindegreeZminindegreeZminoutdegreeZ	maxdegreeZmaxindegreeZmaxoutdegree)ÚyesÚno) ÚblackÚwhiteÚblueÚredÚgreenÚyellowÚmagentaZ	lightgreyÚcyanZdarkgreyZdarkblueZdarkredZ	darkgreenZ
darkyellowZdarkmagentaZdarkcyanZgoldZ	lightblueZlightredZ
lightgreenZlightyellowZlightmagentaZ	lightcyanZlilacZ	turquoiseZ
aquamarineZkhakiÚpurpleZyellowgreenZpinkZorangeÚorchid)ÚboxZellipseZrhombÚtriangle)ÚcenterZleft_justifyZright_justify)ZsolidÚlineÚnone)Z
continuousZdashedZdottedZ	invisible)ÚalgosÚbooleansÚcolorsÚshapesÚ	textmodesÚarrowstylesÚ
linestylesÚtitleé    ÚlabelÚcolorr   Ú	textcolorÚbordercolorÚwidthé   ÚheightÚborderwidthÚtextmoder   Úshaper   ÚshrinkÚstretchZorientationr   Úvertical_orderÚhorizontal_orderZxspaceZyspacer   )ZlayoutalgorithmZlate_edge_labelsZdisplay_edge_labelsZdirty_edge_labelsZ
finetuningZmanhattan_edgesZsmanhattan_edgesZport_sharingÚedgesÚnodesZsplines)r   r   r   r    r!   r"   r$   r%   r&   r'   r(   r)   r*   r+   Z
sourcenameZ
targetnameZ	linestyler   ÚclassZ	thicknessZ
arrowcolorZbackarrowcolorZ	arrowsizeZbackarrowsizeZ
arrowstyler   ZbackarrowstyleÚpriorityÚanchorc                   @   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© r6   úX/var/www/secure340b-portal/env/lib/python3.10/site-packages/pylint/pyreverse/vcgutils.pyÚ__init__Ÿ   s   
zVCGPrinter.__init__c                 K   s0   | j  d| j ¡ |  ¡  | jtfi |¤Ž dS )zopen a vcg graph
        z
%sgraph:{
N)r3   Úwriter4   Ú_inc_indentÚ_write_attributesÚGRAPH_ATTRS)r5   Úargsr6   r6   r7   Ú
open_graph£   s   zVCGPrinter.open_graphc                 C   s   |   ¡  | j d| j ¡ dS )zclose a vcg graph
        z%s}
N)Ú_dec_indentr3   r9   r4   ©r5   r6   r6   r7   Úclose_graphª   s   zVCGPrinter.close_graphc                 K   s8   | j  d| j|f ¡ | jtfi |¤Ž | j  d¡ dS )zdraw a node
        z%snode: {title:"%s"ú}
N)r3   r9   r4   r;   Ú
NODE_ATTRS)r5   r   r=   r6   r6   r7   Únode°   s   zVCGPrinter.noder2   c                 K   s<   | j  d| j|||f ¡ | jtfi |¤Ž | j  d¡ dS )z-draw an edge from a node to another.
        z*%s%sedge: {sourcename:"%s" targetname:"%s"rB   N)r3   r9   r4   r;   Ú
EDGE_ATTRS)r5   Z	from_nodeZto_nodeZ	edge_typer=   r6   r6   r7   Úedge·   s   ÿÿzVCGPrinter.edgec              	   K   s¼   |  ¡ D ]W\}}z|| }W n ty   td|| ¡ f ƒ‚w |s/| j d| j||f ¡ q|dkrB| j d| j|t|ƒf ¡ q||v rS| j d| j||f ¡ qtd|||f ƒ‚dS )z-write graph, node or edge attributes
        z/no such attribute %s
possible attributes are %sz
%s%s:"%s"
r#   z%s%s:%s
z=value %s isn't correct for attribute %s
correct values are %sN)ÚitemsÚKeyErrorÚ	ExceptionÚkeysr3   r9   r4   Úint)r5   Zattributes_dictr=   ÚkeyÚvalueÚ_typer6   r6   r7   r;   Ã   s,   
þÿÿþÿïzVCGPrinter._write_attributesc                 C   s   d| j  | _ dS )zincrement indentation
        z  %sN©r4   r@   r6   r6   r7   r:   Ý   s   zVCGPrinter._inc_indentc                 C   s   | j dd… | _ dS )zdecrement indentation
        NéþÿÿÿrO   r@   r6   r6   r7   r?   â   s   zVCGPrinter._dec_indentN)r2   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r8   r>   rA   rD   rF   r;   r:   r?   r6   r6   r6   r7   r1   ›   s    
r1   N)rT   Z	ATTRS_VALr<   rC   rE   r1   r6   r6   r6   r7   Ú<module>   sÚ   "ÆAÿþýüûúùø	÷
öõôóòñðïäòÿþýüûúùø	÷
öõôóòñðïî