+
    Ni"                         ^ RI t ^ RIt^ RIt^ RIHtHtHt ^ RIHtH	t	 ^ RI
Ht ^ RIt^ RIHt ^ RIHtHt RtRtRtR	 tR
 R ltR tR tR tR# )    N)AnyDictOptional)Requesturlopen)	HTTPError)utils)LibraryProductAllUNKNOWNc                    Rp\         V 9   d   V \         ,          pRpV \          \        V 9   d   RpV \        ,          pV \         V'       d   V F  pW@9  g   K  XW&   K  	  R# R# )zIf one of the keys of dct is `PLATFORM_ALL` (or `PLATFORM_UNKNOWN`),
remove it and add entries for all available platforms to dct

Args:
    dct: (dictionary) dictionary to expand
    available_platforms: (list of string) name of platforms
FTN)PLATFORM_ALLPLATFORM_UNKNOWN)dctavailable_platformsadd_all_platformsnoteplatforms   &&   W/tmp/fempkg/build/kf6/DESTDIR/usr/lib/python3.14/site-packages/kapidox/preprocessing.pyexpand_platform_allr   '   sk     s<  3 #$ !+H" $ ,     c                \    V ^8  d   QhR\         \        \        \        3,          ,          /# )   return)r   r   strr   )formats   "r   __annotate__r   ?   s#     ` `Xd38n5 `r   c                   \         P                  P                  V 4      '       g   R#  \         P                  P                  V R4      p\         P                  P                  T4      '       g   R#  \        P                  ! \        T4      4      pTf   \
        P                  ! RT  R24       R# RT9   d$   R	T9  d   \
        P                  ! R
T  R24       R# \         P                  P                  \         P                  P                  T 4      4      pRT9   d   TR,          pM\        P                   ! T 4      pT'       g   \
        P                  ! RT  R24       R# T^ ,          P#                  4       TR,          ,           pRT9   d   TR,          pMTpRpRT9   d
   TR,          pTP%                  RTRTRTRTP'                  RR4      RRRT RT/4       RT9   do   TR,          p\)        T4       FC  w  rT
R,          R8X  g   K  RT
R&   YT	&   \
        P                  ! RP+                  T4      4       KE  	  TP%                  RT/4       RT9   d   TR,          pRT9   du   TR,          p\)        T4       FI  w  rRT
9   g   K  T
P-                  RR4      p
YT	&   \
        P                  ! RP+                  T4      4       KK  	  TP%                  RT/4       T#   \         d'   p\
        P                  ! RT : R24        Rp?R# Rp?ii ; i  \         d1   p\        T4       \
        P                  ! RT  R24        Rp?R# Rp?ii ; i)zLook for a `metadata.yaml` file and create a dictionary out it.

Args:
    path: (string) the current path to search.
Returns:
    A dictionary containing all the parsed information, or `None` if it
did not fulfill some conditions.
Nzmetainfo.yamlzUnusual base path z for metainfo.yamlz!Could not load metainfo.yaml for z, skipping itzEmpty metainfo.yaml for subgroupgroupzSubgroup but no group in 	fancynamezCould not find fancy name for :   NNrepo_idFqdocname
public_libdependency_diagrampath	platformsMacOSXmacOSzN{fancyname} uses outdated platform name, please replace "MacOSX" with "macOS".
group_infozTGroup {fancyname} uses outdated platform name, please replace "MacOSX" with "macOS".)osr)   isdirjoinUnicodeDecodeErrorloggingwarningisfileyaml	safe_loadopen	Exceptionprintbasenameabspathr	   parse_fancyname
capitalizeupdateget	enumerate
format_mapreplace)r)   metainfo_fileemetainfodirnamer"   r$   r%   r*   indexxr-   s   &           r   create_metainforI   ?   s    77==T?; 77>>-((>>$}"56 24&FGX'"93D6GH ggrwwt45Gh[)	))$/	8mLM!'')IbM9IH9%DOOY7hll<7d  h[)	!),HEyH$#&	#$%  p!+H!57	 - 	i01xl+
*$";/I%i0q=		(G4A'(e$OO$z%/Z
%;=	 1 {I67O_  ,TH4FGH  a;D6OPs/    K 1L L'LLM%MMc           	        . p\         P                  ! V RR7       F  w  r#pV Uu. uF  qU^ ,          R8X  d   K  VNK  	  upVR&   \        V4      pVf   K;  V Uu. uF  qUVP                  R. 4      9   g   K  VNK  	  upVR&   VR,          '       g   RV9   d   VP	                  V4       K  \
        P                  ! RP                  V4      4       K  	  V# u upi u upi )	zRecursively call create_metainfo() in subdirs of rootdir

Args:
    rootdir: (string)  Top level directory containing the libraries.

Returns:
    A list of metainfo dictionary (see create_metainfo()).

T)topdown.:NNNpublic_source_dirsr'   r-   z{name} has no public libraries)r.   walkrI   r?   appendr2   r3   rA   )rootdirmetalistr)   dirs_drE   s   &      r   
parse_treerU      s     H$7A"6dA$#+11d6Q"4( #'V$Qx||<PRT/U*Uqq$VDG%%)A) @ K KH UV# 8& O# 7 Ws   CCC7Cc                   \        4       p. p. p0 RmpV  F"  p\        Wa4      pVf   K  WrVP                  &   K$  	  V  F  p VR,          pV U	u. uF&  p	V	R,          \        \        39  g   K  V	R,          NK(  	  p
p	VP                  \        V
4      4       \        R V 4       4      p\        W4       TpVR,          '       g   K  \        WbW4      pVP                  V4       K  	  VP                  4        FX  p\!        W-,          P"                  4      ^ 8X  d   W- K'  W-,          P$                  '       g   KA  VP                  W-,          4       KZ  	  \'        VP)                  4       4      W4V3# u up	i   \        \        3 d;    \        P                  ! RP                  T4      4       \        \        R7      .p EL(i ; i)av  Extract the structure (Product/Subproduct/Library) from the metainfo
list.

Args:
    metalist: (list of dict) lists of the metainfo extracted in parse_tree().
    all_maintainers: (dict of dict)  all possible maintainers.

Returns:
    A list of Products, a list of groups (which are products containing
several libraries), a list of Libraries and the available platforms.
r*   r&   z4{fancyname} library lacks valid platform definitions)r&   c              3   V   "   T F  qR ,          VP                  RR4      3x  K!  	  R# 5i)r&   r    N)r?   ).0rH   s   & r   	<genexpr> sort_metainfo.<locals>.<genexpr>   s"     E9afIquuVR019s   ')r'   >   Linuxr,   AndroidFreeBSDWindows)dictextract_productr&   r   r   r>   setKeyError	TypeErrorr2   r3   rA   r   r
   rO   copylen	librariespart_of_grouplistvalues)rQ   all_maintainersproductsgroupsrg   r   rE   productr*   rH   platform_lstr   libkeys   &&            r   sort_metainforr      s    vHFIM !(<%,W\\"  
	6 -I/8 Dy! y1A1C  C &AfIIyL D  &&s<'89 E9EEC5	L!!(iICS!) , }}x}&&'1,](((MM(-(	  !"F7JJJ3D
 )$ 	6OOR'Z13#345I	6s+   E4E/-E/:E4/E44AF?>F?c                    RV 9  d
   RV 9   d   R#  \        W4      pV#   \         d"   p\        P                  ! T4        Rp?R# Rp?ii ; i)a  Extract a product from a metainfo dictionary.

Args:
    metainfo: (dict) metainfo created by the create_metainfo() function.
    all_maintainers: (dict of dict) all possible maintainers

Returns:
    A Product or None if the metainfo does not describe a product.
r-   r!   N)r   
ValueErrorr2   error)rE   rk   rn   rD   s   &&  r   ra   ra      sI     8#8(;(4 as    AAA)rI   rU   )r2   r.   systypingr   r   r   urllib.requestr   r   urllib.errorr   r5   kapidoxr	   kapidox.modelsr
   r   __all__r   r   r   rI   rU   rr   ra    r   r   <module>r~      sW     	 
 & & + "   +  %0`FB4Knr   