+
    ni>  c                   s   R t ^ RIt^ RIt^ RIt^ RIHtHt ^ RIHt ^ RI	H
t
Ht ^ RIt ! R R]4      t ! R R]4      t. t] FY  t]P%                  ]P&                  P)                  ]R	4      4       ]P%                  ]P&                  P)                  ]R
4      4       K[  	  ]P%                  ]P&                  P+                  R4      4       . s/ t/ t/ tRR. RO3R ltR tR tR tR tR tR# )z`
Complete implementation of the XDG Icon Spec
http://standards.freedesktop.org/icon-theme-spec/
N)IniFileis_ascii)xdg_data_dirs)NoThemeErrordebugc                   s   a  ] tR t^t o RtR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tRtV tR# )	IconThemez&Class to parse and validate IconThemesc                2    \         P                  ! V 4       R # Nr    __init__self   &2/usr/lib/python3.14/site-packages/xdg/IconTheme.pyr	   ZIconTheme.__init__           c                    V P                   # r   )namer
   r   r   __repr__ZIconTheme.__repr__   s    yyr   c                s    \         P                  ! WR R.4       \        P                  P	                  V4      V n        \        P                  P                  V P
                  4      w  q n        R# )z
Icon ThemeKDE Icon ThemeN)r    parseospathZdirnamedirZsplitr   )r   fileZnil   && r   r   ZIconTheme.parse   sE    d<1A"BC77??4(77==2ir   c                r   r   )r   r
   r   r   getDirZIconTheme.getDir   s    xxr   c                (    V P                  R RR7      # )NameTZlocalegetr
   r   r   getNameZIconTheme.getName    s    xxtx,,r   c                r   )CommentTr   r   r
   r   r   
getCommentZIconTheme.getComment"   s    xx	$x//r   c                r   )InheritsTlistr   r
   r   r   getInheritsZIconTheme.getInherits$   s    xx
x..r   c                r   )DirectoriesTr$   r   r
   r   r   getDirectoriesZIconTheme.getDirectories&   s    xxDx11r   c                r   )ScaledDirectoriesTr$   r   r
   r   r   getScaledDirectoriesZIconTheme.getScaledDirectories(   s    xx+$x77r   c                r   )Hiddenbooleantyper   r
   r   r   	getHiddenZIconTheme.getHidden*   s    xxyx11r   c                s$    V P                  R 4      # )Exampler   r
   r   r   
getExampleZIconTheme.getExample,   s    xx	""r   c                s*    V P                  R RVR7      # )Sizeintegerr.   groupr   r   	directory   &&r   getSizeZIconTheme.getSize0   s    xxYix@@r   c                s(    V P                  R VR7      # )Contextr5   r   r6   r8   r   
getContextZIconTheme.getContext2   s    xx	x33r   c                s@    V P                  R VR7      pV'       d   V# R# )Typer;   	Thresholdr   r   r7   valuer   r   getTypeZIconTheme.getType4   s    y1Lr   c                n    V P                  R RVR7      pV'       g   V^ 8X  d   V# V P                  V4      # )MaxSizer3   r4   r   r9   r?   r   r   
getMaxSizeZIconTheme.getMaxSize:   3    )DEQJL<<	**r   c                rB   )MinSizer3   r4   rD   r?   r   r   
getMinSizeZIconTheme.getMinSize@   rF   r   c                sP    V P                  R RVR7      pV'       g   V^ 8X  d   V# ^# )r>   r3   r4   r   r?   r   r   getThresholdZIconTheme.getThresholdF   s'    9IFEQJLr   c                sB    V P                  R RVR7      pT;'       g    ^# )Scaler3   r4   r   r?   r   r   getScaleZIconTheme.getScaleM   s"    y	Bzzr   c                s   V P                   R 8X  d   V P                  P                  R4       V P                  R8X  d   MHV P                  R8X  d   V P                  P                  R4       MV P                  P                  R4        V P                  V P                   ,          R,          V n         V P                  V P                   ,          R,          V n         V P                  V P                   ,          R
,          V n	        R#   \         d    T P                  P                  R4        L~i ; i  \         d    T P                  P                  R	4        Li ; i  \         d     T P                  P                  R4        R# i ; i)r   z%[KDE Icon Theme]-Header is deprecatedz.themez.desktopz$.desktop fileExtension is deprecatedUnknown File extensionr   zKey 'Name' is missingr!   zKey 'Comment' is missingr'   zKey 'Directories' is missingN)
defaultGroupwarningsappendfileExtensioncontentr   KeyErrorerrorscommentdirectoriesr
   r   r   checkExtrasZIconTheme.checkExtrasR   s6    00MM  !HI ):-MM  !GHMM  !9:	8T%6%67?DI
	;<<(9(9:9EDL
	?#||D,=,=>}MD  	8KK67	8  	;KK9:	;  	?KK=>	?s6   )D 2)D3 )E &D0/D03&EE&F	F	c                s`   WP                   8X  dC    V P                  V,          R ,          V n         V P                  V,          R,          V n        R
# WP                  4       9   dC    V P                  V,          R,          V n         V P                  V,          R,          V n        R
# \        P                  ! RV4      '       d   \        V4      '       g%   V P                  P                  R	V,          4       R
# R
#   \         d&    T P                  P                  RT,          4        Li ; i  \         d'    T P                  P                  RT,          4        R
# i ; i  \         d    RT n         Li ; i  \         d'    T P                  P                  RT,          4        R
# i ; i)r   z#Key 'Name' in Group '%s' is missingr!   z&Key 'Comment' in Group '%s' is missingr=   r>   r2   z#Key 'Size' in Group '%s' is missing^\[X-Invalid Group name: %sN)rM   rQ   r   rR   rS   rO   r(   r.   rematchr   r   r5   r8   r   
checkGroupZIconTheme.checkGroupr   sY   %%%R LL/7	U LL/	:	 ))++( LL/7	R LL/7	 ((8U++KK7%?@ 1@  R""#H5#PQR  U""#Ke#STU
  ('	(  R""#H5#PQRsF   C= D0 (E$ E< =-D-,D-0-E! E!$E98E9<-F-,F-c                s   W0P                   8X  EdX   \        P                  ! R \        P                  P
                  ,           R,           V4      '       d   R# \        P                  ! R\        P                  P
                  ,           R,           V4      '       d   R# VR8X  d   V P                  WRR7       R# VR8X  d   V P                  WRR7       R# VR8X  d   V P                  WRR7       R# VR8X  d   V P                  WR	R
7       R# VR8X  d   V P                  W4       R# \        P                  ! RV4      '       d   R# V P                  P                  RV,          4       R# W0P                  4       9   Ed   VR8X  d   V P                  WRR
7       R# VR8X  d   V P                  W4       R# VR8X  d?   V P                  W4       VR9  d%   V P                  P                  RV,          4       R# R# VR8X  dU   V P                  WRR
7       V P                  R8w  d/   V P                  P                  RV P                  ,          4       R# R# VR8X  dU   V P                  WRR
7       V P                  R8w  d/   V P                  P                  RV P                  ,          4       R# R# VR8X  dU   V P                  WRR
7       V P                  R8w  d/   V P                  P                  RV P                  ,          4       R# R# VR8X  d   V P                  WRR
7       R# \        P                  ! RV4      '       d   R# V P                  P                  RV,          4       R# R# )z^Name$z^Commentr#   Tr$   r'   r)   r+   r,   r-   r0   ^X-[a-zA-Z0-9-]+Invalid key: %sr2   r3   r:   r=   Scalabler>   zGKey 'Type' must be one out of 'Fixed','Scalable','Threshold', but is %srC   z"Key 'MaxSize' give, but Type is %srG   z"Key 'MinSize' give, but Type is %sz$Key 'Threshold' give, but Type is %srJ   N)Fixedr`   r>   )rM   rY   rZ   xdgLocaleregex
checkValuerS   rO   r(   r.   r   Zkeyr@   r5      &&&&r   checkKeyZIconTheme.checkKey   s   %%%xx

 0 004c::*SZZ%5%55c93??
"6%6++6;	!+,c22""#4s#:;))++f};	!++ BBKK&&'psx'xy C	!;99
*KK&&'Kdii'WX +	!;99
*KK&&'Kdii'WX +#;99+KK&&'MPTPYPY'YZ ,;,c22""#4s#:;5 ,r   )rT   r   rU   r   r.   N)__name__
__module____qualname____firstlineno____doc__r	   r   r   r   r    r"   r&   r(   r*   r/   r1   r9   r<   rA   rE   rH   rI   rK   rV   r\   rh   __static_attributes____classdictcell__Z__classdict__   @r   r   r      sy     ,3
-0/282#A4++
?@A./< /<r   r   c                   sZ   a  ] tR t^t o RtR tR tR tR tR t	R t
R tR	 tR
 tRtV tR# )IconDataz*Class to parse and validate IconData Filesc                r   r   r   r
   r   r   r	   ZIconData.__init__   r   r   c                sH    V P                  4       pV'       d
   R V,          # R# )z<IconData: %s>z
<IconData>)getDisplayName)r   Zdisplaynames   & r   r   ZIconData.__repr__   s!    ))+#k11r   c                s6    \         P                  ! WR .4       R# )z	Icon DataN)r    r   )r   r   r8   r   r   ZIconData.parse   s    d;-0r   c                s(    V P                  RRR7      # )zBRetrieve the display name from the icon data, if one is specified.ZDisplayNameTr   r   r
   r   r   rs   ZIconData.getDisplayName   s    xxdx33r   c                *    V P                  RRRR7      # )zrRetrieve the embedded text rectangle from the icon data as a list of
numbers (x0, y0, x1, y1), if it is specified.EmbeddedTextRectangler3   Tr.   r%   r   r
   r   r   getEmbeddedTextRectangleZ!IconData.getEmbeddedTextRectangle   s     xx/idxKKr   c                rt   )z|Retrieve the anchor points for overlays & emblems from the icon data,
as a list of co-ordinate pairs, if they are specified.AttachPointspointTrv   r   r
   r   r   getAttachPointsZIconData.getAttachPoints   s     xxW4x@@r   c                sb    V P                   R 8w  d   V P                  P                  R4       R# R# ).iconrL   N)rP   rN   rO   r
   r   r   rV   ZIconData.checkExtras   s(    (MM  !9: )r   c                s    WP                   8X  ge   \        P                  ! R V4      '       d   \        V4      '       g5   V P                  P                  RVP                  RR4      ,          4       R# R# R# )rW   rX   ZasciiZreplaceN)rM   rY   rZ   r   rS   rO   Zencoder[   r8   r   r\   ZIconData.checkGroup   sU    ***HHXu%%(5//KK7%,,wPY:ZZ[ +: +r   c                s   \         P                  ! R \        P                  P                  ,           R,           V4      '       d   R
# VR8X  d   V P                  WRRR7       R
# VR8X  d   V P                  WRRR7       R
# \         P                  ! RV4      '       d   R
# V P                  P                  R	V,          4       R
# )z^DisplayNamer]   ru   r3   Trv   rx   ry   r^   r_   N)rY   rZ   rb   rc   rd   re   rS   rO   rf   rg   r   rh   ZIconData.checkKey   s    88N3::#3#33C7==++OOCYTOBN"OOCW4O@XX(#..KK0367r    N)ri   rj   rk   rl   rm   r	   r   r   rs   rw   rz   rV   r\   rh   rn   ro   rp   rq   r   rr   rr      s=     0 14LA;
\8 8r   rr   ZiconsZpixmapsz~/.iconsc                s   VR8X  d   \         P                  P                  pVR8X  d   \         P                  P                  p\        P
                  P                  V 4      '       d   V # \        P
                  P                  V 4      ^,          R,          V9   d'   \        P
                  P                  V 4      ^ ,          p \        . 8X  g   \        ^ ,          P                  V8w  d   \        \        V4      4      sWV\        V4      3p \        V,          w  rV\        P                  ! 4       V,
          \         P                  P                  8  d	   \        V MV# \         F9  p\#        WWs4      pV'       g   K  \        P                  ! 4       V3\        V&   Vu # 	  \$         EF  pV\&        9  g   \)        \        P                  ! 4       \&        V,          ^,          ,
          4      \         P                  P                  8  g   Ke  \&        V,          ^,          \        P
                  P+                  V4      8  g   K  \        P
                  P-                  V4      '       g   K  \        P.                  ! V4      \        P                  ! 4       \        P
                  P+                  V4      3\&        V&   EK  	  \&        P1                  4        F|  w  rV Fq  p V R,           V,           V
^ ,          9   dR   \        P
                  P3                  WR,           V,           4      p\        P                  ! 4       V.\        V&   Vu u # Ks  	  K~  	  VR8w  d-   \9        WR4      p\        P                  ! 4       V.\        V&   V# R#   \          d     EL9i ; i  \4         d   p\6        '       d   Th Rp?K  Rp?ii ; i)a  Get the path to a specified icon.

size :
  Icon size in pixels. Defaults to ``xdg.Config.icon_size``.
theme :
  Icon theme name. Defaults to ``xdg.Config.icon_theme``. If the icon isn't
  found in the specified theme, it will be looked up in the basic 'hicolor'
  theme.
extensions :
  List of preferred file extensions.

Example::

    >>> getIconPath("inkscape", 32)
    '/usr/share/icons/hicolor/32x32/apps/inkscape.png'
N:   NN.Zhicolor)rb   ConfigZ	icon_sizeZ
icon_themer   r   Zisabssplitextthemesr   r%   __get_themesZtuple
icon_cachetime
cache_timerR   
LookupIconicondirs	dir_cacheintgetmtimeisdirlistdiritemsjoinZUnicodeDecodeErrorr   getIconPath)iconnamesizetheme
extensionsZtmpZ	timestampZiconZthmer7   r   values	extensionZes   &&&&         r   r   r      s   ( t|zz##}

%% 
ww}}X 
ww!!$R(J677##H-a0 	"&)..E1l5)* 5%
"3
4C$S/	 IIK)#

(=(==3K($;4#yy{D1JsOK	  X	Y&DIIK)I"6q"99:cjj>S>SS)$Q'"''*:*:9*EEi(($&JJy$9499;HXHXYbHc#dIi   !(#I	c>I-:77<<^i-GHD'+yy{D&9JsOK ; $ ) 	89599;-
3 I  : & 5G	s+   N	 A(N	NNN?&N::N?c                s2   \         P                  P                  V 4      '       dr   \         P                  P                  V 4      ^ ,          R,           p\         P                  P                  V4      '       d   \	        4       pVP                  V4       V# R# R# )zRetrieve the data from the .icon file corresponding to the given file. If
there is no .icon file, it returns None.

Example::

    getIconData("/usr/share/icons/Tango/scalable/places/folder.svg")
r{   N)r   r   isfiler   rr   r   )r   Z	icon_fileZdatas   &  r   getIconDatar   P  sj     
ww~~dGG$$T*1-7	77>>)$$:DJJy!K % r   c              #  s  "   \          F  p\        P                  P                  WR4      p\        P                  P	                  V4      '       d    Md\        P                  P                  WR4      p\        P                  P	                  V4      '       g   K   M	  \
        '       d   \        V 4      hR# \        4       pVP                  V4       Vx  VP                  4        F  p\        V4       F  pVx  K	  	  K  	  R# 5i)zbGenerator yielding IconTheme objects for a specified theme and any themes
from which it inherits.
zindex.themezindex.desktopN)r   r   r   r   r   r   r   r   r   r&   r   )Z	themenamer   Z
theme_filer   ZsubthemeZts   &     r   r   r   _  s      WW\\#-@
77>>*%%WW\\#/B
77>>*%%  5y))KE	KK

K%%'h'AG ( (s   BDD*ADc           	      s   VP                   \        9  d   . \        VP                   &   \        VP                   ,          P                  \        P                  ! 4       \        P
                  P                  ^,           ,
          4       \        VP                   ,          P                  ^ 4       \        VP                   ,          P                  \        4       4       \        \        P                  ! 4       \        VP                   ,          ^ ,          ,
          4      \        P
                  P                  8  Ed   \        P                  ! 4       \        VP                   ,          ^ &   VP                  4        EF  p\         EF  p\        P                  P                  WRP                   V4      pV\        VP                   ,          ^,          9  gj   \        VP                   ,          ^,          \        P                  P                  \        P                  P                  WRP                   4      4      8  g   K  VR8w  g   K  \        P                  P                  V4      '       g   K  V\        P                   ! V4      .\        VP                   ,          ^,          V&   \        P                  P                  \        P                  P                  WRP                   4      4      \        VP                   ,          ^&   EK  	  EK  	  \        VP                   ,          ^,          P#                  4        Fv  w  rg\%        V^ ,          W4      '       g   K   V FP  pV R,           V,           V^,          9   g   K!  \        P                  P                  W`R,           V,           4      u u # 	  Kx  	  Rp	Rp
\        VP                   ,          ^,          P#                  4        Fv  w  rg\'        V^ ,          W4      pW8  g   K   V FP  pV R,           V,           V^,          9   g   K!  \        P                  P                  W`R,           V,           4      p
Tp	KR  	  Kx  	  V
# )r}   Z r~   l        )r   theme_cacherO   r   rb   r   r   Zdictr   r(   r   r   r   r   r   r   r   r   DirectoryMatchesSizeDirectorySizeDistance)r   r   r   r   subdirr7   r   r   r   Zminimal_sizeZclosest_filenameZdistances   &&&&        r   r   r   v  s   zz$"$EJJEJJ&&tyy{cjj6K6Ka6O'PQEJJ&&q)EJJ&&tv. 499;UZZ0334

8M8MM%)YY[EJJ"**,F%X	ggll9ZZ?{5::6q99uzz*1-0@0@iXbXbAc0ddbLGGMM#&&7=rzz#6OK

+A.s3131A1A"'',,yYcYcBd1eK

+A. & - #5::.q1779q	477'	c>I-:77<<^i-GHH ( : L"5::.q1779(D@"'	c>I-:')ww||CC)9S'T$#+L ( : r   c                 sP   VP                  V 4      pVP                  V 4      pVP                  V 4      pVP                  V 4      pVP	                  V 4      pVR 8X  d   WA8H  # VR8X  d   Yau;8*  ;'       d    V8*  # u # VR8X  d#   WE,
          Tu;8*  ;'       d    WE,           8*  # u # R# )ra   Z	Scaleabler>   N)rA   r9   rI   rH   rE   r   Ziconsizer   r=   r2   r>   rG   rC      &&&     r   r   r     s    == D== D""6*Iv&Gv&Gw		--g----		8??t/????? 
r   c                 s   VP                  V 4      pVP                  V 4      pVP                  V 4      pVP                  V 4      pVP	                  V 4      pVR 8X  d   \        WA,
          4      # VR8X  d   W8  d	   Wa,
          # W8  d	   Wq,
          # ^ # VR8X  d-   WV,
          8  d	   Wa,
          # WV,           8  d	   W,
          # ^ # R# )ra   r`   r>   N)rA   r9   rI   rH   rE   Zabsr   r   r   r   r     s    == D== D""6*Iv&Gv&Gw4?##		%%%%		Y&&%%y((%% 
r   )ZpngZsvgZxpm) rm   r   r   rY   Zxdg.IniFiler    r   Zxdg.BaseDirectoryr   Zxdg.Exceptionsr   r   Z
xdg.Configrb   r   rr   r   ZbasedirrO   r   r   Z
expanduserr   r   r   r   r   r   r   r   r   r   r|   r   r   <module>r      s   
  	 ) + . i< i<X38w 38n GOOBGGLL'23OOBGGLL)45  	"":. / 
	
!%tBW Pd.%N@r   