+
    ni\3  c                   s|    R t ^ RIt^ RIt^ RIt^ RIt^ RIHtHtHtH	t	H
t
HtHt ^ RIt^ RIHt R t ! R R4      tR# )z5
Base Class for DesktopEntry, IconTheme and IconData
N)ParsingErrorDuplicateGroupErrorNoGroupError
NoKeyErrorDuplicateKeyErrorValidationErrordebug)uc                sP     V P                  RR4       R#   \         d     R# i ; i)z>Return True if a string consists entirely of ASCII characters.ZasciistrictTF)ZencodeZUnicodeError)Zs   &0/usr/lib/python3.14/site-packages/xdg/IniFile.pyis_asciir      s*    	(# s    %%c                   s   a  ] tR t^t o RtRtRtRtR R ltR t	R R lt
R!R ltR tR	 tR R
 ltR"R ltR tR tR#R ltR tR tR tR tR tR tR tR$R ltR$R ltR tR tR%R ltR tR t R R lt!R t"Rt#V t$R# )&IniFile FNc                sZ    \        4       V n        V'       d   V P                  V4       R # R # N)Zdictcontentparse)selffilename   &&r
   __init__ZIniFile.__init__   s    vJJx      c                sB    \        V P                  VP                  4      # r   )Zcmpr   )r   Zotherr   r
   __cmp__ZIniFile.__cmp__!   s    4<<//r   c                sr   V P                   p\        P                  P                  V4      '       g   \	        RV4      h \
        P                  ! VRRRR7      pT;_uu_ 4        T EF   pTP                  4       pT'       g   K  T^ ,          R8X  d   K.  T^ ,          R8X  dU   TP                  R4      P                  R	4      p\        '       d#   T P                  T4      '       d   \        Yq4      h/ Y7&   K   TP                  R
^4      w  rTP                  4       p \        '       d%   T P!                  TX4      '       d   \#        YT4      hT	P                  4       TX,          T&   EK  	  RRR4       Yn        RT n        T'       d3   T F  p
Y9   g   K  Yn         R# 	  \	        RT^ ,          ,          T4      hR#   \         d   p\        '       d   Th Rp?R# Rp?ii ; i  \         d    \	        RT,           T4      hi ; i  \$        \&        3 d    \	        RT4      hi ; i  + '       g   i     L; i)zaParse an INI file.

headers -- list of headers the parser will try to select as a default header
File not foundZrutf-8Zreplace)encodingerrorsNZ#[]Z=zInvalid line: z#Parsing error on key, group missingFz[%s]-Header missing)r   ospathZisfiler    ioopenZIOErrorr   ZstripZlstripZrstriphasGroupr   split
ValueErrorhasKeyr   Z
IndexErrorZUnboundLocalErrorr   tainteddefaultGroup)r   r   Zheadersr   ZfdelineZcurrentGroupkeyvalueZheaders   &&&        r
   r   ZIniFile.parse$   s    ,,ww~~h''/::		 3KB Rzz|!W^!W^#';;s#3#:#:3#?Lu|!<!<1,II02-N%)ZZQ%7
 ))+C\ 5T[[l%C%C"3Cx"PP9>GL1#67  @ ! !$(.% "
 ##871:#ExPP W  	u		6 & N*+;d+BHMMN '(9: \*+PRZ[[\; Rsl   F< #A*H&H&%H&7G#H&H(H &H&H&<G GG #H	H&H#	#H&&H6	c                s   V'       g   V P                   pW P                  9   de   WP                  V,          9   dN   V'       d+   V P                  V,          V P                  W4      ,          pMV P                  V,          V,          pMiV'       g   \        '       dT   W P                  9  d   \	        W P
                  4      hWP                  V,          9  d   \        WV P
                  4      hMR pVR8X  d   V P                  X4      p. p	MX.pV F  pVR8X  d   V P                  V4      pMvVR8X  d    \        V4      pMbVR8X  d    \        V4      pMNVR8X  d   \        P                  ! V4      pM0VR8X  d*   VP                  R4      w  r\        V
4      \        V4      3pVR8X  d   X	P                  V4       K  Tp	K  	  X	#   \         d    ^ p L1i ; i  \         d    Rp LDi ; i)	r   Tbooleanintegernumericg        regexpointZ,)r&   r   _IniFile__addLocaler   r   r   r   getList_IniFile__getBooleanintr#   floatrecompiler"   append)r   r)   grouplocaletypelistr   r*   valuesZresultZxZys   &&&&&&&     r
   getZIniFile.geth   s   %%E \\!||E/B(BU+D,<,<S,HIU+C0,&umm<<U 33$S?? 4 4<\\%(FFWFEy ))%0"JE " !%LE 

5){{3'AAt|e$- 0 % " E
 "  E s$   6G
GGGG)(G)c                s   \         P                  ! R V4      '       d   \         P                  ! RV4      pMm\         P                  ! RV4      '       d   \         P                  ! RV4      pM8\         P                  ! RV4      '       d   \         P                  ! RV4      pMV.pVR,          R8X  d   VP                  4        V# )z	(?<!\\)\;z(?<!\\);z	(?<!\\)\|z(?<!\\),r   i)r5   Zsearchr"   pop)r   stringr;      && r
   r1   ZIniFile.getList   s    99\6**88K0DYY|V,,88L&1DYY{F++88K0D8D8r>HHJr   c                sb    V^8X  g   VR8X  g   VR8X  d   R# V^ 8X  g   VR8X  g   VR8X  d   R# R# )   trueZTrueTfalseZFalseF )r   r+   r   r
   Z__getBooleanZIniFile.__getBoolean   s5    a<7f,60A\W/7g3Er   c                s    V'       g   V P                   p\        P                  P                   F(  pV: RV: R2pW@P                  V,          9   g   K&  Vu # 	  V# )z3add locale to key according the current lc_messagesr   r   )r&   xdgLocalelangsr   )r   r)   r8   ZlangZlangkeys   &&&  r
   Z__addLocaleZIniFile.__addLocale   sK     %%EJJ$$D"%t,G,,u-- %
 
r   c                s   . V n         . V n        \        P                  P	                  V P
                  4      ^,          V n        V P                  4        V P                   F  pV P                  V4       V P                  V,           Fp  pV P                  W0P                  V,          V,          V4       V P                  V,          V,          R8X  g   KN  V P                   P                  RV,          4       Kr  	  K  	  RpVR8X  g   VR8X  d$   V P                    F  pVRV,           ,          pK  	  VR8X  g   VR8X  d$   V P                   F  pVRV,           ,          pK  	  V'       d   \        W@P
                  4      hR# )zValidate the contents, raising :class:`~xdg.Exceptions.ValidationError`
if there is anything amiss.

report can be 'All' / 'Warnings' / 'Errors'
r   zValue of Key '%s' is emptyAllZWarningsz
- ZErrorsN)warningsr   r   r   Zsplitextr   fileExtensioncheckExtrasr   
checkGroupcheckKeyr7   r   )r   Zreportr8   r)   Zmsgr(   s   &&    r
   validateZIniFile.validate   s4      WW--dmm<Q? 	 \\EOOE"||E**c<<#6s#;UC<<&s+r1MM(()E)KL	 + " U?f
2v}$ & U?f0v}$ $ !#}}55 r   c                    R # r   rD   r   r8   r   r
   rL   ZIniFile.checkGroup       r   c                rO   r   rD   )r   r)   r*   r8   s   &&&&r
   rM   ZIniFile.checkKey   rQ   r   c                s8   VR 8X  d   V P                  V4      pMV.pV F  pVR8X  d   V P                  V4      pVR8X  d   K$  VR8X  d   V P                  V4      pMcVR8X  d   V P                  V4      pMJVR8X  d   V P	                  V4      pM1VR8X  d   V P                  V4      pMVR8X  d   V P                  V4      pX^8X  d&   V P                  P                  RV: R	V: 24       K  V^8X  g   K  V P                  P                  R
V,          4       K  	  R# )Tr?   Zlocalestringr+   r-   r,   r.   r/   Z'z' is not a valid zValue of key '%s' is deprecatedN)
r1   checkStringcheckBooleancheckNumbercheckInteger
checkRegex
checkPointr   r7   rI   )r   r)   r*   r:   r;   r<   Zcodes   &&&&&  r
   
checkValueZIniFile.checkValue   s    4<\\%(FWFEx''.~%"((/"''."((/u-u-qy""ud#KL$$%F%LM% r   c                rO   r   rD   r   r	   r
   rK   ZIniFile.checkExtras  rQ   r   c                sJ    VR 8X  g   VR8X  d   ^# VR8X  g   VR8X  g   ^# R# R# )Z1Z0rB   rC   NrD   r   r*   r   r
   rS   ZIniFile.checkBoolean  s*    SLESL6/Ug%5 &6/r   c                .     \        V4       R#     ^# ; irA   N)r4   rZ   r   r
   rT   ZIniFile.checkNumber  s    	%L	    c                r[   r\   )r3   rZ   r   r
   rU   ZIniFile.checkInteger  s    	J	r]   c                sD    \         P                  ! R V4      '       g   ^# R# )z^[0-9]+,[0-9]+$N)r5   matchrZ   r   r
   rW   ZIniFile.checkPoint$  s    xx)511 2r   c                s,    \        V4      '       d   ^ # ^# )i    )r   rZ   r   r
   rR   ZIniFile.checkString(  s    UOOq**r   c                sD     \         P                  ! V4       R#     ^# ; ir\   )r5   r6   rZ   r   r
   rV   ZIniFile.checkRegex+  s    	JJu	s    c           	     s6   V'       g   V P                   '       g   \        R R4      hV'       d   Wn         MV P                   p\        P                  P	                  V4      '       dv   \        P                  P                  \        P                  P	                  V4      4      '       g4   \        P                  ! \        P                  P	                  V4      4       \        P                  ! VRRR7      ;_uu_ 4       pV'       d   VP                  \        R4      4       V P                  '       d   VP                  \        R4      V P                  ,          4       V P                  V P                  ,          P                  4        F'  w  rEVP                  \        R4      WE3,          4       K)  	  VP                  \        R4      4       V P                  P                  4        F  w  rgW`P                  8w  g   K  VP                  \        R4      V,          4       VP                  4        F'  w  rEVP                  \        R4      WE3,          4       K)  	  VP                  \        R4      4       K  	  R	R	R	4       V'       dx   \        P                  ! V4      P                  pV\        P                   ,          \        P"                  ,          \        P$                  ,          p	\        P&                  ! W4       R
V n        R	#   + '       g   i     L; i)r   r   Zwr   )r   z#!/usr/bin/env xdg-open
z[%s]
z%s=%s
Z
NF)r   r    r   r   ZdirnameZisdirZmakedirsr   r    writer   r&   r   ZitemsstatZst_modeZS_IXUSRZS_IXGRPZS_IXOTHZchmodr%   )
r   r   ZtrustedZfpr)   r*   namer8   ZoldmodeZmodes
   &&&       r
   r_   ZIniFile.write2  s   /44$M}}H77??8$$RWW]]277??8;T-U-UKK12WWXsW55 678   8t'8'889$(LL1B1B$C$I$I$KLSHHQy\SL89 %L4!!%!3!3!5,,,HHQx[4/0(-9!<= )6HHQtW% "6 6, ggh'//GT\\)DLL84<<GDHHX$7 65s   =4L2CL>A:LL	c                s   V'       g   V P                   pVR 8X  d_   \        \        P                  P                  4      ^ 8  d7   VR,           \        P                  P                  ^ ,          ,           R,           p W P
                  V,          V&   Y P                  Y4      8H  T n
        R#   \         d    \        Y0P                  4      hi ; i)Tr   r   N)r&   ZlenrE   rF   rG   r   KeyErrorr   r   r=   r%   )r   r)   r*   r8   r9   s   &&&&&r
   setZIniFile.set[  s    %%ET>c#**"2"23a7)cjj..q11C7C	5',LL$ #!55  	5umm44	5s   ;B* *!Cc                s    V P                  V4      '       d$   \        '       d   \        WP                  4      hR# / V P                  V&   R V n        R# )TN)r!   r   r   r   r   r%   rP   r   r
   addGroupZIniFile.addGroupj  sA    ==u)%??  #%DLLDLr   c                s    WP                   9   pV'       d   V P                   V R V n        V# \        '       d   \        WP                  4      hV# )T)r   r%   r   r   r   )r   r8   Zexistedr@   r
   removeGroupZIniFile.removeGroupr  sF    <<'U#DL  u"5--88r   c                sT   V'       g   V P                   p V'       d   \        V P                  V,          4       Fk  p\        P                  ! R V,           \
        P                  P                  ,           R,           V4      '       g   KO  WA8w  g   KW  V P                  V,          V Km  	  V P                  V,          P                  V4      pRV n	        V#   \         dI   p\        '       d2   Yb8X  d   \        Y P                  4      h\        YT P                  4      h Rp?R# Rp?ii ; i)Z^Z$TNr   )r&   r;   r   r5   r^   rE   rF   r.   r>   r%   rb   r   r   r   r   )r   r)   r8   Zlocalesra   r*   r'   s   &&&&   r
   	removeKeyZIniFile.removeKey|  s    %%E	 e!45Dxxc	CJJ,<,< <s BDIIdk LL/5 6 LL'++C0EDLL 	u:&umm<<$S??	s*   C A&C 	C AC D'=D""D'c                s6    V P                   P                  4       # r   )r   ZkeysrY   r	   r
   groupsZIniFile.groups  s    ||  ""r   c                s    WP                   9   # r   )r   rP   r   r
   r!   ZIniFile.hasGroup  s    $$r   c                sT    V'       g   V P                   pWP                  V,          9   # r   )r&   r   )r   r)   r8   s   &&&r
   r$   ZIniFile.hasKey  s"    %%Ell5)))r   c                s    V P                   # r   )r   rY   r	   r
   getFileNameZIniFile.getFileName  s    }}r   )r   r&   r   rJ   r   r%   rI   r   )NFr?   FF)rH   )r?   F)NF)NT)%Z__name__Z
__module__Z__qualname__Z__firstlineno__r&   rJ   r   r%   r   r   r   r=   r1   r2   r0   rN   rL   rM   rX   rK   rS   rT   rU   rW   rR   rV   r_   rc   rd   re   rf   rg   r!   r$   rh   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r
   r   r      s     LMHG!
0AQH2l%6PN4+'R7 .#%* r   r   )Z__doc__r5   r   r`   r   Zxdg.Exceptionsr    r   r   r   r   r   r   Z
xdg.LocalerE   Zxdg.utilr   r   r   rD   r   r
   <module>ri      s:     # # #  M Mr   