| Server IP : 35.80.110.71 / Your IP : 216.73.216.52 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/IPython/core/__pycache__/ |
Upload File : |
�
}�e] � � � d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z ddl
mZmZ ddl
mZmZmZ G d � d
e� Z G d� de� Zy)
z3An object for managing IPython profile directories.� N)�Path)�LoggingConfigurable� )�get_ipython_package_dir)�expand_path�ensure_dir_exists)�Unicode�Bool�observec � � e Zd Zy)�ProfileDirErrorN)�__name__�
__module__�__qualname__� � �9/usr/lib/python3/dist-packages/IPython/core/profiledir.pyr
r
s � �r r
c �� � e Zd ZdZ ed� Z ed� Z ed� Z ed� Z ed� Z ed� Z
ed� Z ed� Z ed� Z
ed� Z edd� � j d
�� Z ed� Z ed
� d� � Zd"d�Z ed� d"d�� Z ed� d"d�� Z ed� d"d�� Z ed� d"d�� Zd� Zd#dededefd�Zed"d�� Z ed$d�� Z!ed$d �� Z"ed"d!�� Z#y)%�
ProfileDira@ An object to manage the profile directory and its resources.
The profile directory is used by all IPython applications, to manage
configuration, logging and security.
This object knows how to find, create and manage these directories. This
should be used by any code that wants to handle profiles.
�security�log�startup�pid�static� zaSet the profile location directly. This overrides the logic used by the
`profile` option.)�helpT)�configF�locationc �V � | j rt d� �d| _ |d }t |� t j j || j � | _ t j j || j � | _ t j j || j � | _ t j j || j � | _
t j j || j � | _ | j! � y )Nz+Cannot set profile location more than once.T�new)�_location_isset�RuntimeErrorr �os�path�join�security_dir_name�security_dir�log_dir_name�log_dir�startup_dir_name�startup_dir�pid_dir_name�pid_dir�static_dir_name�
static_dir�
check_dirs)�self�changer s r �_location_changedzProfileDir._location_changed8 s� � �����L�M�M�#����U�m���#�� �G�G�L�L��d�.D�.D�E����w�w�|�|�C��):�):�;����7�7�<�<��T�-B�-B�C����w�w�|�|�C��):�):�;����'�'�,�,�s�D�,@�,@�A������r Nc �� � t j j |� r=|r:t j |� j |k7 r t j
||� yy |rt j ||� yt j |� y# t $ r | j j d|� Y yw xY w# t $ r(}|j t j k( rY d}~y� d}~ww xY w)a� ensure a directory exists at a given path
This is a version of os.mkdir, with the following differences:
- returns True if it created the directory, False otherwise
- ignores EEXIST, protecting against race conditions where
the dir may have been created in between the check and
the creation
- sets permissions if requested and the dir already exists
zCould not set permissions on %sFNT)r# r$ �exists�stat�st_mode�chmod�OSErrorr �warning�mkdir�errno�EEXIST)r1 r$ �mode�es r �_mkdirzProfileDir._mkdirH s� � � �7�7�>�>�$�������
�-�-��5���H�H�T�4�(� � ������t�$� � ����� ��# � ��H�H�$�$�9��� ��� � ��w�w�%�,�,�&���� �s6 �B �B9 �7B9 �%B6�5B6�9 C*�C%�$C%�%C*r) c �: � | j | j � y �N)r@ r) �r1 r2 s r �
check_log_dirzProfileDir.check_log_dirj s � ����D�L�L�!r r+ c � � | j | j � t j j | j d� }t j j t � ddd� }t j j
|� s| j j d|� t j j
|� r7t j j
|� st j ||� y y y )N�README�core�profile�README_STARTUPzLCould not copy README_STARTUP to startup dir. Source file %s does not exist.)r@ r+ r# r$ r% r r5 r r: �shutil�copy)r1 r2 �readme�srcs r �check_startup_dirzProfileDir.check_startup_dirn s� � ����D�$�$�%������d�.�.��9���g�g�l�l�2�4�g�z�K\�]���w�w�~�~�c�"��H�H���k�mp�q�
�7�7�>�>�#��r�w�w�~�~�f�'=��K�K��V�$� (>�r r'