File manager - Edit - /usr/local/CyberCP/lib/python3.10/site-packages/docker/api/__pycache__/container.cpython-310.pyc
Back
o �hj� � @ sV d dl m Z ddlmZmZ ddlmZ ddlmZmZm Z m Z mZ G dd� d�ZdS ) � )�datetime� )�errors�utils)�DEFAULT_DATA_CHUNK_SIZE)�CancellableStream�ContainerConfig�EndpointConfig� HostConfig�NetworkingConfigc @ sV e Zd Ze�d� dHdd��Ze�d�dIdd��Ze�d� dJd d ��Z dKdd �Z dLdd�Z dd� Z dMdd�Zdd� Zdd� Z dd� Ze�d�dd� �Ze�d�efdd��Ze�d�edfdd��Ze�d�d d!� �Ze�d�dNd"d#��Ze�d� dOd%d&��Ze�d�d'd(� �Ze�d�d)d*� �Ze�d�d+d,� �Ze�d-�dNd.d/��Ze�d�dPd0d1��Ze�d�d2d3� �Ze�d�d4d5� �Ze�d�dQd7d8��Ze�d�d9d:� �Ze�d�dRd;d<��Z e�d�dNd=d>��Z!e�d�dNd?d@��Z"e�d�dAdB� �Z#e�dC�e�d� dSdDdE���Z$e�d�dMdFdG��Z%dS )T�ContainerApiMixin� containerTFc C s� |rdpd|r dp d|rdpd|rdpdd�}ddd�}| � d|�} | j| ||dd �} | j| || �|�|d �}|r>t|| �S |S )aI Attach to a container. The ``.logs()`` function is a wrapper around this method, which you can use instead if you want to fetch/stream container output without first retrieving the entire backlog. Args: container (str): The container to attach to. stdout (bool): Include stdout. stderr (bool): Include stderr. stream (bool): Return container output progressively as an iterator of strings, rather than a single string. logs (bool): Include the container's previous output. demux (bool): Keep stdout and stderr separate. Returns: By default, the container's output as a single string (two if ``demux=True``: one for stdout and one for stderr). If ``stream=True``, an iterator of output strings. If ``demux=True``, two iterators are returned: one for stdout and one for stderr. Raises: :py:class:`docker.errors.APIError` If the server returns an error. � r )�logs�stdout�stderr�stream�Upgrade�tcp�� Connectionr �/containers/{0}/attachT)�headers�paramsr )�demux)�_url�_post�_read_from_socket� _check_is_ttyr )�selfr r r r r r r r �u�response�output� r# �G/usr/local/CyberCP/lib/python3.10/site-packages/docker/api/container.py�attach s ��� zContainerApiMixin.attachNc C sz |du r dddd�}d|vrd| j v r| j d |d<