+
    niu  c                   s   R t ^ RIt^ RIt]P                  P	                  R4      t]P                  P                  R4      ;'       g    ]P                  P                  ]RR4      t	]	.]P                  P                  R4      ;'       g    RP                  R4      ,           t]P                  P                  R	4      ;'       g    ]P                  P                  ]R
4      t].]P                  P                  R4      ;'       g    RP                  R4      ,           t]P                  P                  R4      ;'       g    ]P                  P                  ]R4      t]P                  P                  R4      ;'       g    ]P                  P                  ]RR4      t] U u. uF  q '       g   K  V NK  	  up t] U u. uF  q '       g   K  V NK  	  up tR tR tR tR tR tR tR tRR ltR# u up i u up i )a  
This module is based on a rox module (LGPL):

http://cvs.sourceforge.net/viewcvs.py/rox/ROX-Lib2/python/rox/basedir.py?rev=1.9&view=log

The freedesktop.org Base Directory specification provides a way for
applications to locate shared data and configuration:

    http://standards.freedesktop.org/basedir-spec/

(based on version 0.6)

This module can be used to load and save from and to these directories.

Typical usage:

    from rox import basedir
    
    for dir in basedir.load_config_paths('mydomain.org', 'MyProg', 'Options'):
        print "Load settings from", dir

    dir = basedir.save_config_path('mydomain.org', 'MyProg')
    print >>file(os.path.join(dir, 'Options'), 'w'), "foo=2"

Note: see the rox.Options module for a higher-level API for managing options.
NZ~ZXDG_DATA_HOMEz.localZshareZXDG_DATA_DIRSz/usr/local/share:/usr/shareZ:ZXDG_CONFIG_HOMEz.configZXDG_CONFIG_DIRSz/etc/xdgZXDG_CACHE_HOMEz.cacheZXDG_STATE_HOMEZstatec                 s   \         P                  P                  ! V !  p \         P                  P                  \        V 4      p\         P                  P	                  V4      '       g   \         P
                  ! VR4       V# )zEnsure ``$XDG_CONFIG_HOME/<resource>/`` exists, and return its path.
'resource' should normally be the name of your application. Use this
when saving configuration settings.
  )ospathjoinxdg_config_homeisdirmakedirsresourcer      * 6/usr/lib/python3.14/site-packages/xdg/BaseDirectory.pysave_config_pathr   4   sP    
 ww||X&H77<<2D77==
D% K    c                     \         P                  P                  ! V !  p \         P                  P                  \        V 4      p\         P                  P	                  V4      '       g   \         P
                  ! V4       V# )zEnsure ``$XDG_DATA_HOME/<resource>/`` exists, and return its path.
'resource' should normally be the name of your application or a shared
resource. Use this when saving or updating application data.
)r   r   r   xdg_data_homer   r   r   r	   r
   save_data_pathr   @   sN    
 ww||X&H77<<x0D77==
DKr   c                 r   )zEnsure ``$XDG_CACHE_HOME/<resource>/`` exists, and return its path.
'resource' should normally be the name of your application or a shared
resource.)r   r   r   xdg_cache_homer   r   r   r	   r
   save_cache_pathr   L   N     ww||X&H77<<1D77==
DKr   c                 r   )zEnsure ``$XDG_STATE_HOME/<resource>/`` exists, and return its path.
'resource' should normally be the name of your application or a shared
resource.)r   r   r   xdg_state_homer   r   r   r	   r
   save_state_pathr   W   r   r   c               '     "   \         P                  P                  ! V !  p \         FM  p\         P                  P                  W4      p\         P                  P	                  V4      '       g   KI  Vx  KO  	  R# 5i)zReturns an iterator which gives each directory named 'resource' in the
configuration search path. Information provided by earlier directories should
take precedence over later ones, and the user-specific config dir comes
first.N)r   r   r   xdg_config_dirsexists)r   Z
config_dirr      *  r
   load_config_pathsr   b   sL     
 ww||X&H%
ww||J177>>$t &   A)A:0
A:c                 s*    \        V !   F  pVu # 	  R# )zUReturns the first result from load_config_paths, or None if there is nothing
to load.N)r   )r   xr	   r
   load_first_configr   l   s     ) *r   c               '  r   )zReturns an iterator which gives each directory named 'resource' in the
application data search path. Information provided by earlier directories
should take precedence over later ones.N)r   r   r   xdg_data_dirsr   )r   Zdata_dirr   r   r
   load_data_pathsr   s   sL      ww||X&H!ww||H/77>>$t "r   c                s    \         P                  R,          #   \         EdT    T '       d   h ^ RIpRTP	                  4       ,           pRp \         P
                  ! T4      p\        P                  ! TP                  4      '       g   \         P                  ! T4       RpMTP                  \         P                  ! 4       8w  g=   TP                  \        P                  \        P                  ,          ,          '       d   \         P                  ! T4       RpM:  \         d-   p^ RIpTP                   TP"                  8X  d   Rp Rp?M	h Rp?ii ; iT'       d   \         P$                  ! TR4       Tu # i ; i)a  Returns the value of $XDG_RUNTIME_DIR, a directory path.

This directory is intended for 'user-specific non-essential runtime files
and other file objects (such as sockets, named pipes, ...)', and
'communication and synchronization purposes'.

As of late 2012, only quite new systems set $XDG_RUNTIME_DIR. If it is not
set, with ``strict=True`` (the default), a KeyError is raised. With 
``strict=False``, PyXDG will create a fallback under /tmp for the current
user. This fallback does *not* provide the same guarantees as the
specification requires for the runtime directory.

The strict default is deliberately conservative, so that application
developers can make a conscious decision to allow the fallback.
ZXDG_RUNTIME_DIRNz /tmp/pyxdg-runtime-dir-fallback-FTr    )r   environZKeyErrorgetpassZgetuserZlstatstatZS_ISDIRZst_modeZunlinkZst_uidZgetuidZS_IRWXGZS_IRWXOZrmdirZOSErrorerrnoZENOENTZmkdir)Zstrictr    ZfallbackZcreateZstZer"   s   &      r
   get_runtime_dirr#   |   s    "zz+,,  58II	 (#B <<

++		(#))ryy{***t|| ;<<"  	ww%,,&	" HHXu%A sQ    E8E8D"BE8E8E%!EE8EE
E8E87E8)T)Z__doc__r   r!   r   Z
expanduserZ_homer   Zgetr   r   Zsplitr   r   r   r   r   r   r   r   r   r   r   r   r#   )r   s   0r
   <module>r$      s  6 
3

/ 3 3GGLL'2  ZZ^^O$EE(ELLSQR **..!23 + +GGLL	*  ##ZZ^^%&44*;;C@A  01 * *GGLL)   01 3 3GGLL'2  */MqQM/-3o11o3

		,,2W 03s    	G..G.;	G3	G3