File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/relenv/build/common/__pycache__/ui.cpython-310.pyc
Back
o ;jR6 � @ s� d Z ddlmZ ddlZddlZddlZddlZddlmZm Z m Z er;ddlZddlZddl mZmZ ddlmZ ndZddlmZ dd lmZ e�e�Zd ZdZdZd ZdZdZej �!d�rcdZnej"dkrzej �!d�Z#ej �!d�Z$e#sze$szdZer�g d�Z%dZ&dZ'dZ(dZ)ng d�Z%dZ&dZ'dZ(dZ)dZ*dFd d!�Z+G d"d#� d#�Z,e,� Z-G d$d%� d%e �Z. dGdHd/d0�Z/ 1dIdJd8d9�Z0dKd:d;�Z1dLd=d>�Z2dMdBdC�Z3G dDdE� dEej4�Z5dS )Nz$ UI and build statistics utilities. � )�annotationsN)� TYPE_CHECKING� TypedDict�cast)�MutableMapping�Sequence)�Event)�DATA_DIR� )�CICDz[0;32mz[1;33mz[0;31mz[0mz[FTZRELENV_ASCIIF�win32Z WT_SESSIONZTERM_PROGRAM) u ⠋u ⠙u ⠹u ⠸u ⠼u ⠴u ⠦u ⠧u ⠇u ⠏u ◯u ✓u ✗)�|�/�-�\�o�+�Xzbuild_stats.json�return�pathlib.Pathc C s t t S )a Get the path to the build statistics file. Returns: Path to build_stats.json in the relenv data directory. Note: This is a function rather than a module-level constant to avoid import-time dependencies on DATA_DIR, following CPython conventions. )r �BUILD_STATS_FILENAME� r r �J/opt/saltstack/salt/lib/python3.10/site-packages/relenv/build/common/ui.py�_get_build_stats_fileK s r c @ s: e Zd ZdZddd�Zdd d �Zddd�Zdddd�Zd S )�SpinnerStatez�Thread-safe spinner state management. Tracks the animation frame index for each named spinner to ensure smooth, consistent animation across multiple UI updates. r �Nonec C s i | _ t�� | _dS )z2Initialize empty spinner state with thread safety.N)�_state� threading�Lock�_lock)�selfr r r �__init___ s zSpinnerState.__init__�name�str�intc C s8 | j � | j�|d�W d � S 1 sw Y dS )z�Get the current frame index for a named spinner. Args: name: The spinner identifier Returns: The current frame index (0 if spinner hasn't been used yet) r N�r r �get�r r"