%PDF- %PDF-
| Direktori : /usr/lib/python3/dist-packages/xdg/__pycache__/ |
| Current File : //usr/lib/python3/dist-packages/xdg/__pycache__/BaseDirectory.cpython-312.pyc |
�
�u�cu � �t � d Z ddlZddlZej j d� Zej j d� xs ej j edd� Z e gej j d� xs dj d � z Zej j d
� xs ej j ed� Zegej j d� xs d
j d � z Z
ej j d� xs ej j ed� Zej j d� xs ej j edd� ZeD � cg c] } | s�| �� c} Ze
D � cg c] } | s�| �� c} Z
d� Zd� Zd� Zd� Zd� Zd� Zd� Zdd�Zyc c} w c c} 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 � � t j j | � } | j d� rJ �t j j t | � }t j j |� st j |d� |S )z�Ensure ``$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�
startswith�xdg_config_home�isdir�makedirs��resourcer s �3/usr/lib/python3/dist-packages/xdg/BaseDirectory.py�save_config_pathr 4 sa � �
�w�w�|�|�X�&�H��"�"�3�'�'�'�
�7�7�<�<���2�D�
�7�7�=�=���
���D�%� ��K� c � � t j j | � } | j d� rJ �t j j t | � }t j j |� st j |� |S )z�Ensure ``$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 r r �
xdg_data_homer r r s r �save_data_pathr @ s_ � �
�w�w�|�|�X�&�H��"�"�3�'�'�'�
�7�7�<�<�
�x�0�D�
�7�7�=�=���
���D���Kr c � � t j j | � } | j d� rJ �t j j t | � }t j j |� st j |� |S )z�Ensure ``$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 r r �xdg_cache_homer r r s r �save_cache_pathr! L �_ � � �w�w�|�|�X�&�H��"�"�3�'�'�'�
�7�7�<�<���1�D�
�7�7�=�=���
���D���Kr c � � t j j | � } | j d� rJ �t j j t | � }t j j |� st j |� |S )z�Ensure ``$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 r r �xdg_state_homer r r s r �save_state_pathr% W r"