File: //lib/python3/dist-packages/DistUpgrade/__pycache__/DistUpgradeViewNonInteractive.cpython-38.pyc
U
B��]&6 � @ sR d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl
Z
d dlZ d dlm
Z
mZ d dl mZmZ ddlmZmZmZ ddlmZ ddlmZ G dd � d e�ZG d
d� de�ZG dd
� d
e�Zedk�rNe� Ze� Ze� Ze� dd� e �!� Z"ej#dd� D ]Z$e"e$ �%� �qe"�&ee� e�'d� e�(d � dS )� N)�NoSectionError�
NoOptionError)�PIPE�Popen� )�DistUpgradeView�InstallProgress�AcquireProgress)�get)�DistUpgradeConfigc @ s e Zd Zdd� ZdS )�NonInteractiveAcquireProgressc C sT t �| ||||� |tjkrPtd|| jt�t| j��f � t j
�� rPt j
�� d S )Nzfetched %s (%.2f/100) at %sb/s)
r �
update_status�apt_pkgZ STAT_DONE�print�percentZsize_to_str�intZcurrent_cps�sys�stdout�isatty�flush)�selfZuriZdescrZ
shortDescr�status� r �K/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeViewNonInteractive.pyr
, s
�
z+NonInteractiveAcquireProgress.update_statusN)�__name__�
__module__�__qualname__r
r r r r r + s r c @ sP e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zdd
� Z dd� Z
dd� ZdS )�NonInteractiveInstallProgressz�
Non-interactive version of the install progress class
This ensures that conffile prompts are handled and that
hanging scripts are killed after a (long) timeout via ctrl-c
c C s� t �| � t�d� dtjkr(dtjd<