
    ޺i#                        S SK r S SKrS SKrS SKJr  S SKJr  S SKJrJ	r	  S SK
JrJrJrJrJrJrJrJr  S SKJr  SSKJr  S	\S
\S\S\\\      S\\\      S\S\S\S\\\\\\\4   4S jrS	\S
\S\\\\\4   4S jrS\S\S\S\S\\\      S\\\      S\SS4S jrS\S\S\\\      S\\\      S\4
S jr\S	\S
\S\\\      S\\\      S\S\S\S\\\\\\\\4      4S j5       rS	\S
\S\\\      S\\\      S\S\S\S\\\\\\\/\\   4   S\\   4S jr      S$S	\S
\S\S\\\      S\\\      S\S\S\S\\   4S  jjr     S%S!\S"\\   S	\S
\S\\\      S\\\      S\S\S\S\\   4S# jjr g)&    N)contextmanager)unified_diff)Pool	cpu_count)AnyCallableIterableIteratorListOptionalTextTuple)TTFont   )get_file_modtime
filepath_a
filepath_b
tmpdirpathinclude_tablesexclude_tablesfont_number_afont_number_buse_multiprocessreturnc           	          [        X5      u  pp[        XS9n[        XS9n[        R                  R	                  US5      n[        R                  R	                  US5      n[        UUUUUUU5        XXX4$ )N)
fontNumberzleft.ttxz	right.ttx)_get_pre_post_pathsr   ospathjoin_mp_save_ttx_xml)r   r   r   r   r   r   r   r   post_pathnamepostpathpre_pathnameprepathtt_lefttt_rightleft_ttxpathright_ttxpaths                   R/var/www/piano.thomer.com/venv/lib/python3.13/site-packages/fontTools/diff/diff.py_get_fonts_and_save_xmlr+      s     6I62M\ W7Gh9H77<<
J7LGGLL[9M }VV    c                     U nUnU nUnXSXB4$ N )r   r   r%   r#   r$   r"   s         r*   r   r   2   s#     GHLML99r,   r&   r'   r(   r)   c                     U(       a?  [        5       S:  a1  XXT4XXT4/n[        SS9 nUR                  [        U5        S S S 5        g [        XXT5        [        XXT5        g ! , (       d  f       g = f)Nr      )	processes)r   r   starmap_ttfont_save_xml)	r&   r'   r(   r)   r   r   r   mp_args_listpools	            r*   r!   r!   =   sj     IK!O NCnE
 A$LL)<8  	O.Q s   A  
A.ttffilepathc                 $    U R                  XUS9  g)z;Writes TTX specification formatted XML to disk on filepath.)tables
skipTablesT)saveXML)r7   r8   r   r   s       r*   r4   r4   Y   s     KKNKKr,   c              #      #    [         R                  " 5        n[        U UUUUUUU5      v   S S S 5        g ! , (       d  f       g = f7fr.   )tempfileTemporaryDirectoryr+   )r   r   r   r   r   r   r   r   s           r*   _saved_ttx_filesr@   d   sE      
	$	$	&*%	
 		
 
'	&	&s   A6	A
A Acreate_differc           	   #      #    [        U UUUUUU5       u  nn	n
nnnU" UU	U
UUU5       S h  vN   S S S 5        g  N! , (       d  f       g = f7fr.   )r@   )r   r   r   r   r   r   r   rA   r(   r)   r$   r%   r"   r#   s                 r*   _diff_with_saved_ttx_filesrC   {   sx      


 
 	
 	
!
 
 	
!
 
s%   A<:<	A<
A
Acontext_linesc              #      ^#    S[         S[         S[         S[         S[         S[         S[        [            4U4S jjn[        U UUUUUUU5       S	h  vN   g	 N7f)
av  Performs a unified diff on a TTX serialized data format dump of font binary data using
a modified version of the Python standard libary difflib module.

filepath_a: (string) pre-file local file path
filepath_b: (string) post-file local file path
context_lines: (int) number of context lines to include in the diff (default=3)
include_tables: (list of str) Python list of OpenType tables to include in the diff
exclude_tables: (list of str) Python list of OpentType tables to exclude from the diff
use_multiprocess: (bool) use multi-processor optimizations (default=True)

include_tables and exclude_tables are mutually exclusive arguments.  Only one should
be defined

:returns: Generator of ordered diff line strings that include newline line endings
:raises: KeyError if include_tables or exclude_tables includes a mis-specified table
that is not included in filepath_a OR filepath_b
r(   r)   r$   r%   r"   r#   r   c           
   3   @  >#    [        U 5       nUR                  5       nS S S 5        [        U5       nUR                  5       n	S S S 5        [        U5      n
[        U5      n[        WW	UUU
UTS9 S h  vN   g ! , (       d  f       N`= f! , (       d  f       NM= f N'7f)N)n)open	readlinesr   r   )r(   r)   r$   r%   r"   r#   ff	fromlinestftolinesfromdatetodaterD   s               r*   _create_unified_diff$u_diff.<locals>._create_unified_diff   s      ,2I  - BllnG ! $G,!(+
 	
 	
    	
s>   BA:BB0B4B5B:
BB
BBNr   r	   rC   )	r   r   rD   r   r   r   r   r   rP   s	     `      r*   u_diffrS      s}     8


 
 	

 
 
 
$
4 *	 	 	s   AAAA	diff_tool	diff_argsc	              #      ^ ^#    S[         S[         S[         S[         S[         S[         S[        [            4UU 4S jjn	[        UUUUUUUU	5       S	h  vN   g	 N7f)
a  Performs a unified diff on a TTX serialized data format dump of font binary data using
an external diff executable that is requested by the caller via `command`

diff_tool: (string) command line executable string
diff_args: (list of strings) arguments for the diff tool
filepath_a: (string) pre-file local file path
filepath_b: (string) post-file local file path
include_tables: (list of str) Python list of OpenType tables to include in the diff
exclude_tables: (list of str) Python list of OpentType tables to exclude from the diff
use_multiprocess: (bool) use multi-processor optimizations (default=True)

include_tables and exclude_tables are mutually exclusive arguments.  Only one should
be defined

:returns: Generator of ordered diff line strings that include newline line endings
:raises: KeyError if include_tables or exclude_tables includes a mis-specified table
that is not included in filepath_a OR filepath_b
:raises: IOError if exception raised during execution of `command` on TTX files
r(   r)   _pre_pathname_prepath_post_pathname	_postpathr   c              3     >#    T/T
-   X/-   n[         R                  " U[         R                  [         R                  SS9nUR                   H  nUv   M	     UR                  R                  5       n	U	(       a  [        U	5      eg 7f)Nutf8)stdoutstderrencoding)
subprocessPopenPIPEr]   r^   readIOError)r(   r)   rW   rX   rY   rZ   commandprocesslineerrrU   rT   s             r*   _create_external_diff0run_external_diff.<locals>._create_external_diff  sy      +	)\,II""????	
 NNDJ #nn!!##, s   BBNrR   )
rT   rU   r   r   r   r   r   r   r   ri   s
   ``        r*   run_external_diffrk      s     >  	
   
$ , *	 	 	s   AAAA)   NNrm   T)NNrm   rm   T)!r   r`   r>   
contextlibr   difflibr   multiprocessingr   r   typingr   r   r	   r
   r   r   r   r   fontTools.ttLibr   utilsr   intboolr+   r   r!   r4   r@   rC   rS   rk   r/   r,   r*   <module>rv      s   	   %   + Q Q Q " #WWW W T$Z(	W
 T$Z(W W W W 4tT4-.W<::: 4tT!":RRR R 	R
 T$Z(R T$Z(R R 
R8	 T$Z( T$Z(	
 
 


 T$Z(
 T$Z(	

 
 
 
 eD$dD$678
 
,!
!
!
 T$Z(!
 T$Z(	!

 !
 !
 !
 T4tT4@(4.PQ!
 d^!
\ +/+/!??? ? T$Z(	?
 T$Z(? ? ? ? d^?N ,0+/!>>Dz> > 	>
 T$Z(> T$Z(> > > > d^>r,   