← Back
Editing: paths.cpython-311.pyc
� �@�c� � � � d Z ddlZddlZddlZddlmZ ddlZddlm Z ddl mZmZm Z mZmZmZ defd�Zdefd�Zdefd �Zd � Zd d�ZdS )z/Find files and directories which IPython uses. � N)�warn)�import_item)�get_home_dir�get_xdg_dir�get_xdg_cache_dir� compress_user� _writable_dir�ensure_dir_exists�returnc �n � t j } t j j }d}t � � }t � � }d| v rt dt � � | � d| � dd� � � � }|�� |||� � }|r� ||d� � }t |� � r�t }t j � |� � r6t d� ||� � ||� � � � � � nWt j � |� � r6t d� ||� � ||� � � � � � n|}t j � t j � |� � � � }t j � |� � rEt |� � s6t d � |� � � � t! j � � }n�t j � |� � szt j � |� � }t |� � s6t d � |� � � � t! j � � }nt j |d�� � t) |t* � � s J d � � �|S )z�Get the IPython directory for this platform and user. This uses the logic in `get_home_dir` to find the home directory and then adds .ipython to the end of the path. z.ipython�IPYTHON_DIRzdThe environment variable IPYTHON_DIR is deprecated since IPython 3.0. Please use IPYTHONDIR instead.� IPYTHONDIRN�ipythonzDIgnoring {0} in favour of {1}. Remove {0} to get rid of this messagez>{0} is deprecated. Move link to {1} to get rid of this messagezEIPython dir '{0}' is not a writable location, using a temp directory.zHIPython parent '{0}' is not a writable location, using a temp directory.T)�exist_okz:all path manipulation should be str(unicode), but are not.)�os�environ�path�joinr r r �DeprecationWarning�getr r �exists�format�islink�normpath� expanduser�tempfile�mkdtemp�dirname�makedirs� isinstance�str) �env�pjoin� ipdir_def�home_dir�xdg_dir�ipdir� xdg_ipdir�cu�parents �//usr/lib/python3/dist-packages/IPython/paths.py�get_ipython_dirr, s� � � �*�C��G�L�E� �I��~�~�H��m�m�G������ 1�2D� F� F� F��G�G�L�#�'�'�-��">�">�?�?�E��}���h� �*�*��� &� ��g�y�1�1�I��Y�'�'� &�"���7�>�>�%�(�(� &�� 2�39�6�"�"�Y�-�-���E���3S�3S�U� U� U� U��W�^�^�I�.�.� &�� 2�39�6�"�"�Y�-�-���E���3S�3S�U� U� U� U� &�E��G���R�W�/�/��6�6�7�7�E� �w�~�~�e��� .�]�5�%9�%9� .�� +�+1�6�%�=�=� :� :� :�� �"�"��� �W�^�^�E� "� "� .������'�'���V�$�$� .�� /�/5�v�f�~�~� ?� ?� ?��$�&�&�E�E��K���-�-�-�-��e�S�!�!�_�_�#_�_�_�_��L� c �8 � t � � } | �t � � S t j � | d� � }t j � |� � st | � � rt |� � nt | � � st � � S |S )z;Get the cache directory it is created if it does not exist.Nr )r r, r r r r r r )�xdgdirr'