Ë Îã¤ÃÖ*Èãót—dZddlZddlZejj d«Zej jd«xsejjedd«Z e gej jd«xsdjd «zZ ej jd «xsejjed «Z e gej jd «xsd jd «zZ ej jd«xsejjed«Zej jd«xsejjedd«Ze D�cgc]}|sŒ|‘Œ c}Z e D�cgc]}|sŒ|‘Œ c}Z d„Zd„Zd„Zd„Zd„Zd„Zd„Zdd„Zycc}wcc}w)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. éNÚ~Ú XDG_DATA_HOMEz.localÚshareÚ XDG_DATA_DIRSz/usr/local/share:/usr/shareÚ:ÚXDG_CONFIG_HOMEz.configÚXDG_CONFIG_DIRSz/etc/xdgÚXDG_CACHE_HOMEz.cacheÚXDG_STATE_HOMEÚstatecó—tjj|Ž}|jd«rJ‚tjjt|«}tjj |«stj |d«|S)zºEnsure ``$XDG_CONFIG_HOME//`` exists, and return its path. 'resource' should normally be the name of your application. Use this when saving configuration settings. Ú/éÀ)ÚosÚpathÚjoinÚ startswithÚxdg_config_homeÚisdirÚmakedirs©Úresourcers ú6/usr/lib/python3.12/site-packages/xdg/BaseDirectory.pyÚsave_config_pathr4sa€ô �w‰w�|‰|˜XÐ&€HØ×"Ñ" 3Ô'Ð'Ð 'Ü �7‰7�<‰<œ¨Ó 2€DÜ �7‰7�=‰=˜Ô Ü � ‰ �D˜%Ô Ø €Kócó—tjj|Ž}|jd«rJ‚tjjt|«}tjj |«stj |«|S)zÓEnsure ``$XDG_DATA_HOME//`` 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)rrrrÚ xdg_data_homerrrs rÚsave_data_pathr@s_€ô �w‰w�|‰|˜XÐ&€HØ×"Ñ" 3Ô'Ð'Ð 'Ü �7‰7�<‰<œ  xÓ 0€DÜ �7‰7�=‰=˜Ô Ü � ‰ �DÔØ €Krcó—tjj|Ž}|jd«rJ‚tjjt|«}tjj |«stj |«|S)zœEnsure ``$XDG_CACHE_HOME//`` exists, and return its path. 'resource' should normally be the name of your application or a shared resource.r)rrrrÚxdg_cache_homerrrs rÚsave_cache_pathr!Ló_€ô�w‰w�|‰|˜XÐ&€HØ×"Ñ" 3Ô'Ð'Ð 'Ü �7‰7�<‰<œ¨Ó 1€DÜ �7‰7�=‰=˜Ô Ü � ‰ �DÔØ €Krcó—tjj|Ž}|jd«rJ‚tjjt|«}tjj |«stj |«|S)zœEnsure ``$XDG_STATE_HOME//`` exists, and return its path. 'resource' should normally be the name of your application or a shared resource.r)rrrrÚxdg_state_homerrrs rÚsave_state_pathr%Wr"rc'óâK—tjj|Ž}tD]F}tjj||«}tjj |«sŒC|–—ŒHy­w)zïReturns 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)rrrÚxdg_config_dirsÚexists)rÚ config_dirrs rÚload_config_pathsr*bsLèø€ô �w‰w�|‰|˜XÐ&€Hß%ˆ Ü�w‰w�|‰|˜J¨Ó1ˆÜ �7‰7�>‰>˜$Õ  t£ñ&ùó ‚A%A/Á(A/có$—t|ŽD]}|cSy)zYReturns the first result from load_config_paths, or None if there is nothing to load.N)r*)rÚxs rÚload_first_configr.ls€ô Ó )ˆØŠð*à rc'óâK—tjj|Ž}tD]F}tjj||«}tjj |«sŒC|–—ŒHy­w)zÀReturns 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)rrrÚ xdg_data_dirsr()rÚdata_dirrs rÚload_data_pathsr2ssLèø€ô�w‰w�|‰|˜XÐ&€Hß!ˆÜ�w‰w�|‰|˜H hÓ/ˆÜ �7‰7�>‰>˜$Õ  t£ñ"ùr+cóŒ— tjdS#t$�r$|r‚ddl}d|j «z}d} tj |«}t j|j«stj|«d}nž|jtj«k7s.|jt jt jzzrOtj|«d}n7#t$r+}ddl}|j |j"k(rd}n‚Yd}~nd}~wwxYw|rtj$|d«|cYSwxYw)aReturns 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. ÚXDG_RUNTIME_DIRrNz /tmp/pyxdg-runtime-dir-fallback-FTr)rÚenvironÚKeyErrorÚgetpassÚgetuserÚlstatÚstatÚS_ISDIRÚst_modeÚunlinkÚst_uidÚgetuidÚS_IRWXGÚS_IRWXOÚrmdirÚOSErrorÚerrnoÚENOENTÚmkdir)Ústrictr7ÚfallbackÚcreateÚstÚerDs rÚget_runtime_dirrL|s€ð "Ü�z‰zÐ+Ñ,Ð,øÜ ó Ù Ø ãØ5¸¿¹Ó8IÑIˆØˆð ô—‘˜(Ó#ˆBô—<‘< § ¡ Ô+Ü— ‘ ˜(Ô#Ø‘à—)‘)œrŸy™y›{Ò*Ø—*‘*¤§ ¡ ¬t¯|©|Ñ ;Ò<Ü—‘˜Ô"Ø‘øôò Û Ø�w‰w˜%Ÿ,™,Ò&Ø‘àôûð úñ" Ü �H‰H�X˜uÔ %àŠðA ús9‚•&E¼C/ÁBEÃ/ D#Ã8!DÄEÄD#Ä#EÅE)T)Ú__doc__rr:rÚ expanduserÚ_homer5ÚgetrrÚsplitr0rr'r r$rrr!r%r*r.r2rL)r-s0rÚrRs ðñ÷6à �‰×ј3Ӏؗ ‘ —‘˜Ó/ò3Ø �G‰G�L‰L˜ ¨'Ó 2ðð�؇Z�Z‡^�^�OÓ$ÒEÐ(E×LÑLÈSÓQñR€ ð—*‘*—.‘.Ð!2Ó3ò+Ø �G‰G�L‰L˜  Ó *ðð#Ð#؇Z�Z‡^�^Ð%Ó&Ò4¨*×;Ñ;¸CÓ@ñA€ð—‘—‘Ð 0Ó1ò*Ø �G‰G�L‰L˜ Ó )ðð—‘—‘Ð 0Ó1ò3Ø �G‰G�L‰L˜ ¨'Ó 2ðñ*Ó/™M�qªQ’˜MÑ/€ Ù-Ó3™o˜²’1˜oÑ3€ò ò ò ò ò,òò,ô2ùòW0ùÚ3sÅ4F0Å<F0ÆF5ÆF5