Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/IPython/utils/__pycache__/tempdir.cpython-39.pyc
Ðазад
a o�hK � @ sH d Z ddlZddlmZ ddlmZ G dd� de�ZG dd� de�Z dS ) a This module contains classes - NamedFileInTemporaryDirectory, TemporaryWorkingDirectory. These classes add extra features such as creating a named file in temporary directory and creating a context manager for the working directory which is also temporary. � N)�Path)�TemporaryDirectoryc @ s2 e Zd Zd dd�Zdd� ZeZdd � Zd d� ZdS )�NamedFileInTemporaryDirectory�w+b���Fc K sF t f i |��| _t| jj�| }d|v r,dnd}t||||d�| _dS )aN Open a file named `filename` in a temporary directory. This context manager is preferred over `NamedTemporaryFile` in stdlib `tempfile` when one needs to reopen the file. Arguments `mode` and `bufsize` are passed to `open`. Rest of the arguments are passed to `TemporaryDirectory`. �bNzutf-8)�encoding)r �_tmpdirr �name�open�file)�self�filename�mode�bufsizeZadd_to_syspath�kwds�pathr � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/IPython/utils/tempdir.py�__init__ s z&NamedFileInTemporaryDirectory.__init__c C s | j �� | j�� d S �N)r �closer �cleanup�r r r r r s z%NamedFileInTemporaryDirectory.cleanupc C s | j S r )r r r r r � __enter__# s z'NamedFileInTemporaryDirectory.__enter__c C s | � � d S r )r )r �type�value� tracebackr r r �__exit__&