Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/IPython/utils/__pycache__/io.cpython-39.pyc
Ðазад
a o�h � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl m Z ddlmZm Z G dd � d e�Zdd d�Zdd d�Ze dd� �Ze dd� �ZdS )z IO related utilities. � N)�Path)�warn)�undoc� )� CapturedIO�capture_outputc @ s: e Zd ZdZddd�Zdd� Zdd � Zd d� Zdd � ZdS )�Teez�A class to duplicate an output stream to stdout/err. This works in a manner very similar to the Unix 'tee' command. When the object is closed or deleted, it closes the original file given to it for duplication. �w�stdoutc C sx |dvrt d| ��t|d�r0t|d�r0|| _n d|v r<dnd}t|||d�| _|| _tt|�| _tt|| � d | _ dS ) aN Construct a new Tee object. Parameters ---------- file_or_name : filename or open filehandle (writable) File that will be duplicated mode : optional, valid mode for open(). If a filename was give, open with this mode. channel : str, one of ['stdout', 'stderr'] )r �stderrzInvalid channel spec %s�write�seek�bN�utf-8��encodingF) � ValueError�hasattr�file�open�channel�getattr�sys�ostream�setattr�_closed)�selfZfile_or_name�moder r � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/IPython/utils/io.py�__init__ s zTee.__init__c C s, | � � tt| j| j� | j�� d| _dS )z'Close the file and restore the channel.TN)�flushr r r r r �closer �r r r r r"