Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/IPython/core/__pycache__/profiledir.cpython-39.pyc
Ðазад
a o�h] � @ s� d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z ddl mZmZ ddl mZmZmZ G d d � d e�ZG dd� de�ZdS ) z3An object for managing IPython profile directories.� N)�Path)�LoggingConfigurable� )�get_ipython_package_dir)�expand_path�ensure_dir_exists)�Unicode�Bool�observec @ s e Zd ZdS )�ProfileDirErrorN)�__name__� __module__�__qualname__� r r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/IPython/core/profiledir.pyr s r c @ s2 e Zd ZdZed�Zed�Zed�Zed�Zed�Z ed�Z ed�Zed�Zed�Z ed�Zeddd �jd d�Zed�Zed �dd� �Zd-dd�Zed�d.dd��Zed�d/dd��Zed�d0dd��Zed�d1dd��Zdd � Zd2eeed!�d"d#�Zed3d$d%��Z ed4d'd(��Z!ed5d)d*��Z"ed6d+d,��Z#dS )7� 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�logZstartup�pidZstatic� zaSet the profile location directly. This overrides the logic used by the `profile` option.)�helpT)�configF�locationc C s� | j rtd��d| _ |d }t|� tj�|| j�| _tj�|| j�| _ tj�|| j �| _tj�|| j�| _ tj�|| j�| _| �� d S )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 r r r �_location_changed8 s zProfileDir._location_changedNc C s� t j�|�rV|rRt �|�j|krRzt �||� W n tyP | j�d|� Y n0 dS z |rjt � ||� n t � |� W n@ ty� } z(|j t jkr�W Y d}~dS � W Y d}~n d}~0 0 dS )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)r* r �mode�er r r �_mkdirH s&