관리-도구
편집 파일: self_outdated_check.cpython-39.pyc
a ��Re� � @ s d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlm Z m Z d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d d lmZmZmZ d d lmZ dZe�e �Z!e"e"d�d d�Z#G dd� d�Z$e"e%d�dd�Z&eej'dd�dd�Z(dS )� N)�Any�Dict)�parse)� LinkCollector)� PackageFinder)�get_default_environment)�SelectionPreferences)� PipSession)�adjacent_tmp_file�check_path_owner�replace)� ensure_dirz%Y-%m-%dT%H:%M:%SZ)�key�returnc C s | � � }t�|��� }|S �N)�encode�hashlib�sha224� hexdigest)r � key_bytes�name� r ��/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_internal/self_outdated_check.py�_get_statefile_name s r c @ sB e Zd Zedd�dd�Zeed�dd��Zeejdd�d d �ZdS )�SelfCheckStateN)� cache_dirr c C s� i | _ d | _|r�tj�|dt| j��| _z>t| jdd��}t� |�| _ W d � n1 sZ0 Y W n t ttfy~ Y n0 d S )N� selfcheckzutf-8)�encoding) �state�statefile_path�os�path�joinr r �open�json�load�OSError� ValueError�KeyError)�selfr � statefiler r r �__init__! s �.zSelfCheckState.__init__)r c C s t jS r )�sys�prefix)r) r r r r 2 s zSelfCheckState.key)�pypi_version�current_timer c C s� | j s d S ttj�| j ��s d S ttj�| j �� | j|�t�|d�}t j |ddd�}t| j ��}|�|� � � W d � n1 s�0 Y zt|j| j � W n ty� Y n0 d S )N)r � last_checkr. T)�,�:)� sort_keys� separators)r r r r! �dirnamer r �strftime�SELFCHECK_DATE_FMTr$ �dumpsr �writer r r r&