+
    Qip                    T   ^ RI Ht ^ RIt^ RIt^ RIHt ^ RIHtHt ^ RI	t	^RI
HtHtHtHt ^RIHt ^RIHt ^RIHtHtHt R	 R
 ltR R ltR R lt]3R R lltR R lt]]]3R R llt]P<                  ^ ,          ]P<                  R,          ]P>                  ]] 3R R llt!R# )    )annotationsNwraps)CallableIterator)	AutomatonInputOutputState)findMachines)MethodicalMachine)TypeMachineInputProtocolCorec                    V ^8  d   QhRRRR/#    sstrreturn )formats   "4/usr/lib/python3/dist-packages/automat/_visualize.py__annotate__r      s     0 0 0 0    c                D    R P                  V P                  RR4      4      # )z"{}""z\")r   replacer   s   &r   _gvquoter       s    ==3.//r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r      s      s s r   c                $    R P                  V 4      # )z<{}>)r   r   s   &r   _gvhtmlr#      s    ==r   c               (    V ^8  d   QhRRRRRRRR/# )r   namer   childrenattrsr   r   )r   s   "r   r   r      s(      s s S S r   c                    RP                  R \        VP                  4       4       4       4      pRP                  V4      pRP                  WVR7      # )z7
Construct a string from the HTML element description.
 c           	   3  n   "   T F+  w  rR P                  V\        \        V4      4      4      x  K-  	  R# 5i)z{}={}N)r   r    r   ).0keyvalues   &  r   	<genexpr>elementMaker.<locals>.<genexpr>   s0      /JC 	sHSZ011/s   35 z#<{name} {attrs}>{children}</{name}>)r%   r'   r&   )joinsorteditemsr   )r%   r&   r'   formattedAttrsformattedChildrens   &*,  r   elementMakerr6      sY     XX  / N )0772C 8  r   c          
     ,    V ^8  d   QhRRRRRRRRRR/# )	r   
inputLabelr   outputLabels	list[str]port_EzCallable[..., str]r   r   )r   s   "r   r   r   &   s:             		 
 	 r   c                2   / pV'       d   \        \        V4      4      VR&   V! RV! RV RR7      3RRRV/VB pR	R
/pV Uu. uF  pV! RV! RV3/ VB RR7      NK  	  ppV! RV4      .p	V'       d   V	P                  V! R.VO5!  4       V! R.V	O5!  # u upi )z6
Construct an HTML table to label a state transition.
colspantdfontzmenlo-italic)facecolorpurpler;   z
point-size9pink)rB   trtable)r   lenappend)
r8   r9   r;   r<   r>   inputLabelCell	pointSizeoutputLabeloutputLabelCellsrowss
   &&&&      r   
tableMakerrO   &   s     G \!23	
6:N3  	
 N s#I ('K 	4FK595VD'  
 t^$%DBt/./0gs   Bc                    V ^8  d   QhRRRR/# )r   xCallable[[State], str]r   r   )r   s   "r   r   r   I   s      & +A r   c                6   a  \        S 4      R  V 3R ll4       pV# )c                    V ^8  d   QhRRRR/# )r   tr   r   r   r   )r   s   "r   r   escapify.<locals>.__annotate__K   s     > > ># >r   c                T   < S! V 4      P                  R R4      P                  RR4      # )<z&lt;>z&gt;)r   )rU   rQ   s   &r   implescapify.<locals>.implJ   s%    t||C(00f==r   r   )rQ   rZ   s   f r   escapifyr\   I   s     
1X> > Kr   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   	automatonzAutomaton[State, Input, Output]inputAsStringzCallable[[Input], str]outputAsStringzCallable[[Output], str]stateAsStringrR   r   zgraphviz.Digraphr   )r   s   "r   r   r   Q   s:     7 7.7)7 ,7 *	7
 7r   c           
        \        V4      p\        V4      p\        V4      p\        P                  ! RRRR/RR/RR/R7      pV P                  4        F7  pWPP                  J d   RpR	pMR
pRpVP                  V! V4      VRVRR7       K9  	  \        V P                  4       4       F  w  rV	w  rrRP                  V4      pV! V4      pRp\        TV Uu. uF  pV! V4      NK  	  upVR7      pVP                  V\        V4      RRR7       VP                  V! V
4      RP                  VV4      RR7       VP                  RP                  VV4      V! V4      4       K  	  V# u upi )z9
Produce a L{graphviz.Digraph} object from an automaton.
packtruedpi100fontnameMenlo)
graph_attr	node_attr	edge_attrboldz
Menlo-Boldr0   ellipseblue)fontameshapestylerB   zt{}	tableport)r;   z0.2none)labelmarginrp   z{}:{}:w)	arrowheadz{}:{}:e)r\   graphvizDigraphstatesinitialStatenode	enumerateallTransitionsr   rO   r#   edge)r^   r_   r`   ra   digraphstate
stateShapefontNameneachTransitioninStateinputSymboloutStateoutputSymbolsthisTransitionr8   r;   outputSymbolrG   s   &&&&               r   makeDigraphr   Q   s    ]+Mn-N]+MFE51w'w'G !!#***J#HJH%  	 	
 $ 'y'?'?'AB8F5ha";/
>KLml^L)mL
 	^75>%vV'"^T2 	 	

 	Y%%nd;]8=TU' C* N Ms   E&:   NNc               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r   	_prognamer   _argvr:   _syspath_findMachinesz[Callable[[str], Iterator[tuple[str, MethodicalMachine | TypeMachine[InputProtocol, Core]]]]_printzCallable[..., None]r   Noner   )r   s   "r   r   r      sL     [4 [4[4[4 [4	[4  [4 
[4r   c                   RpRpV^ ,          '       d   VP                  ^ R4       \        P                  ! WVR7      pVP                  RRR7       VP                  RR	R
RRR7       VP                  RRRRR7       VP                  RRRRR7       VP                  RRR\        P
                  RR7       VP                  RRRRRR7       VP                  V4      pVP                  ;'       d3    VP                  '       * ;'       g    VP                  VP                  8g  p	VP                  '       d   R pV! VP                  4       F  w  rV! V
R4       VP                  4       pV	'       dA   VP                  R P                  V
4      VP                  R!7       V! V
R"VP                  4       VP                  '       g   Kz  VP                  '       * ;'       g    T	pVP                  Vn        VP                  R P                  V
4      VP                  VP                   VR#7       V'       d   R$pMR%pV! WVP                  4       EK  	  R&# )'z'
Entry point for command line utility.
zB
    Visualize automat.MethodicalMachines as graphviz graphs.
    zz
    You must have the graphviz tool suite installed.  Please visit
    http://www.graphviz.org for more information.
    r0   )progdescriptionepilogfqpnz@A Fully Qualified Path name representing where to find machines.)helpz--quietz-qzsuppress outputF
store_true)r   defaultactionz--dot-directoryz-dzWhere to write out .dot files.z.automat_visualize)r   r   z--image-directoryz-izWhere to write out image files.z--image-typez-tzThe image format.png)r   choicesr   z--viewz-vz.View rendered graphs with default image viewerc                     R # )Nr   )argss   *r   r   tool.<locals>._print   s    r   z...discoveredz{}.dot)filename	directoryz...wrote dot into)r   r   viewcleanupz...wrote image intoz...wrote image and dot intoN)insertargparseArgumentParseradd_argumentrw   FORMATS
parse_argsdot_directoryimage_directoryquietr   	asDigraphsaver   
image_typerenderr   )r   r   r   r   r   DESCRIPTIONEPILOGargumentParserr   explicitlySaveDotr   machiner   	deleteDotmsgs   &&&&&          r   toolr      sJ   KF {{2,,N R    4/|    -$	    .$	           @    $$U+D**     NND$8$8D<N<N$N  zzz	 'tyy1t_%##%LL(//$"74CUCULV4,d.@.@A ...CC2CI!__GNNN!...YY!	   +34d223- 2r   )"
__future__r   r   sys	functoolsr   typingr   r   rw   _corer   r	   r
   r   	_discoverr   _methodicalr   _typedr   r   r   r    r#   r6   rO   r\   reprr   argvpathprintr   r   r   r   <module>r      s    "  
  %  2 2 # * 4 40$ *	 F -1.2,0	7v XXa[xx|(( 	"'[4 [4r   