| Server IP : 93.86.61.54 / Your IP : 216.73.216.206 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/xdg/__pycache__/ |
Upload File : |
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"