
    h                         S r SSKJr  SSKJrJrJrJrJrJ	r	  SSK
Jr  / SQr " S S\	\R                  S	4   5      r\\\   \\   /S
4   r    SS\S\\   S\S\\\/\4      S\\\/\\R                     4      S\\   4S jjr    SS\S\\   S\S\\\/\4      S\\\/\\R                     4      S\\   4S jjr SS\S\\   S\S\\\/\4      S\S\\\/\\R                     4      S\\   4S jjrg
)z>Methods for traversing trees of otData-driven OpenType tables.    )deque)CallableDequeIterableListOptionalTuple   )	BaseTable)bfs_base_tabledfs_base_tableSubTablePathc                   "    \ rS rSrS\4S jrSrg)r      returnc                     / nU  H@  nUR                   nUR                  b  USUR                   S3-  nUR                  U5        MB     SR                  U5      $ )N[].)nameindexappendjoin)self
path_partsentry	path_parts       S/var/www/html/env/lib/python3.13/site-packages/fontTools/ttLib/tables/otTraverse.py__str__SubTablePath.__str__   sZ    
E

I{{&qQ//	i(	 
 xx
##     N)__name__
__module____qualname____firstlineno__strr   __static_attributes__r"   r!   r   r   r      s    $ $r!   r   .Nrootroot_accessor	skip_root	predicateiter_subtables_fnr   c              #   B   #    [        U UUUS U5       Sh  vN   g N7f)a  Depth-first search tree of BaseTables.

Args:
    root (BaseTable): the root of the tree.
    root_accessor (Optional[str]): attribute name for the root table, if any (mostly
        useful for debugging).
    skip_root (Optional[bool]): if True, the root itself is not visited, only its
        children.
    predicate (Optional[Callable[[SubTablePath], bool]]): function to filter out
        paths. If True, the path is yielded and its subtables are added to the
        queue. If False, the path is skipped and its subtables are not traversed.
    iter_subtables_fn (Optional[Callable[[BaseTable], Iterable[BaseTable.SubTableEntry]]]):
        function to iterate over subtables of a table. If None, the default
        BaseTable.iterSubTables() is used.

Yields:
    SubTablePath: tuples of BaseTable.SubTableEntry(name, table, index) namedtuples
    for each of the nodes in the tree. The last entry in a path is the current
    subtable, whereas preceding ones refer to its parent tables all the way up to
    the root.
c                 6    U R                  [        U5      5      $ N)
extendleftreversedfrontiernews     r   <lambda> dfs_base_table.<locals>.<lambda>A   s    h11(3-@r!   N_traverse_ot_datar)   r*   r+   r,   r-   s        r   r   r      s+     < !@     c              #   B   #    [        U UUUS U5       Sh  vN   g N7f)a   Breadth-first search tree of BaseTables.

Args:
    root
        the root of the tree.
    root_accessor (Optional[str]): attribute name for the root table, if any (mostly
        useful for debugging).
    skip_root (Optional[bool]): if True, the root itself is not visited, only its
        children.
    predicate (Optional[Callable[[SubTablePath], bool]]): function to filter out
        paths. If True, the path is yielded and its subtables are added to the
        queue. If False, the path is skipped and its subtables are not traversed.
    iter_subtables_fn (Optional[Callable[[BaseTable], Iterable[BaseTable.SubTableEntry]]]):
        function to iterate over subtables of a table. If None, the default
        BaseTable.iterSubTables() is used.

Yields:
    SubTablePath: tuples of BaseTable.SubTableEntry(name, table, index) namedtuples
    for each of the nodes in the tree. The last entry in a path is the current
    subtable, whereas preceding ones refer to its parent tables all the way up to
    the root.
c                 $    U R                  U5      $ r0   )extendr3   s     r   r6    bfs_base_table.<locals>.<lambda>j   s    hooc2r!   Nr8   r:   s        r   r   r   F   s+     > !2  r;   add_to_frontier_fnc              #     #    Uc  [        U 5      R                  nUc  S nUc  S n[        5       n[        R                  " X5      nU(       d  UR                  U45        O!U" UU" U 5       Vs/ s H  nXx4PM     sn5        U(       ah  UR                  5       n	U	S   R                  n
U" U	5      (       d  M5  [        U	5      v   U" U
5       Vs/ s H  oU4-   PM
     nnU" Xk5        U(       a  Mg  g g s  snf s  snf 7f)Nc                     g)NTr"   )paths    r   r,   $_traverse_ot_data.<locals>.predicate   s    r!   c                 "    U R                  5       $ r0   )iterSubTables)tables    r   r-   ,_traverse_ot_data.<locals>.iter_subtables_fn   s    &&((r!   )	typer#   r   r   SubTableEntryr   popleftvaluer   )r)   r*   r+   r,   r@   r-   r4   
root_entrysubtable_entryrC   currentnew_entriess               r   r9   r9   o   s     T
++	  	) %*GH((=J& '8&=&=N ,&=	
 !r(..4   <MW;U
;UN$$;U 	 
 	81 ( 
s%   A,C<.C2
;AC<C7C<0C<)NFNNr0   )__doc__collectionsr   typingr   r   r   r   r   r	   otBaser   __all__rK   r   AddToFrontierFnr'   boolr   r   r9   r"   r!   r   <module>rY      s   D  C C $500#56 $ E,/l1CDdJK
 $(:> 	%
%C=% % ,!567	%
  )hy'>'>??@% l%T $(:> 	&
&C=& & ,!567	&
  )hy'>'>??@& l&b 	42
42C=42 42 ,!567	42
 (42  )hy'>'>??@42 l42r!   