Your IP : 216.73.216.172


Current Path : /lib/python3/dist-packages/uaclient/api/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/uaclient/api/__pycache__/__init__.cpython-38.pyc

U

Uٵg	�@sfddlZddlZddlmZe�d��e���Gdd�dejd�ZGdd�de�Z	Gd	d
�d
�Z
dS)�N)�OptionalZ	ubuntuproc@s.eZdZejeeeeeed�dd��ZdS)�AbstractProgress��total_steps�
done_steps�previous_step_message�current_step_messagecCsdS�N���selfrrrrr
r
�7/usr/lib/python3/dist-packages/uaclient/api/__init__.py�progress
s	zAbstractProgress.progressN)	�__name__�
__module__�__qualname__�abc�abstractmethod�intr�strrr
r
r
r
r	s�r)�	metaclassc@s(eZdZeeeeeed�dd�ZdS)�NullProgressrcCsdSr	r
rr
r
r
rszNullProgress.progressN)rrrrrrrr
r
r
r
rs
�rc@sTeZdZdeed�dd�Zed�dd�Zdd	�Zded
�dd�Z	e
d
�dd�ZdS)�ProgressWrapperN)�progress_objectcCs.|dk	r||_nt�|_d|_d|_d|_dS)Nr���)rrrrr)rrr
r
r
�__init__#szProgressWrapper.__init__)�messagecCs2|jj|j|j|j|d�||_|jd7_dS)Nr�)rrrrr)rrr
r
r
r,s�zProgressWrapper.progresscCs&|j|_|jj|j|j|jdd�dS)Nr)rrrrr�rr
r
r
�finish6s�zProgressWrapper.finish)�eventcCst|jd�r|j�||�dS)z�
        This is our secret event system. We use it internally to insert prompts
        and extra messages in the middle of operations at certain points.
        We don't consider this stable enough to expose to the public API.
        �	_on_eventN)�hasattrrr!)rr Zpayloadr
r
r
�emit?szProgressWrapper.emit)�returncCst|jd�r|jjSdSdS)N�is_interactiveF)r"rr%rr
r
r
r%HszProgressWrapper.is_interactive)N)N)rrrrrrrrrr#�boolr%r
r
r
r
r"s
	
		r)rZlogging�typingrZ	getLoggerZ
addHandlerZNullHandler�ABCMetarrrr
r
r
r
�<module>s