Dashboard
PHP:
8.2.30
OS:
Linux
User:
dh_nv8b2m
/
/
usr
/
lib
/
python3
/
dist-packages
/
xdg
/
__pycache__
📤 Upload
📝 New File
📁 New Folder
Close
Editing: BaseDirectory.cpython-310.pyc
o �)Xw � @ s d Z ddlZddlZej�d�Zej�d�pej�edd�Z e gej�d�p'd� d � Zej�d �p8ej�ed�Zegej�d�pBd � d � Z ej�d�pSej�ed�Zdd� eD �Zdd� e D �Z dd� Zdd� Zdd� Zdd� Zdd� Zdd� Zd"d d!�ZdS )#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.cachec C � g | ]}|r|�qS � r ��.0�xr r �3/usr/lib/python3/dist-packages/xdg/BaseDirectory.py� <listcomp>. � r c C r r r r r r r r / r c G sD t jj| � } | �d�r J �t j�t| �}t j�|�s t �|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 r r r �save_config_path1 s r c G �B t jj| � } | �d�r J �t j�t| �}t j�|�st �|� |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 r r r �save_data_path= s r c G r )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 r r r �save_cache_pathI s r"