관리-도구
편집 파일: read.cpython-39.opt-1.pyc
a �����!c�����������������������@���s~���d�dl�mZ�d�dl�mZ�d�dlmZmZ�d�dlZd�dlZ d�dl Zd�dlZd�dlZd�dl Z d�dlZe �d�ZG�dd��de�ZdS�)�����)�absolute_import)�unicode_literals)�_�ucdN�dnfc�������������������@���s,���e�Zd�Zdd��Zdd��Zdd��Zdd��Zd S�) � RepoReaderc�����������������C���s���||�_�||�_d�S�)N)�conf�opts)�selfr���r �����r����1/usr/lib/python3.9/site-packages/dnf/conf/read.py�__init__$���s����zRepoReader.__init__c�������������� ���c���s����|���|�jj�D�] }|V��qg�}|�jjD�](}t�tj�|d��D�]}|�|��q>q&|j dd��d��|D�]F}z|���|�D�] }|V��qtW�qd�t jjy����t �td�|��Y�qd0�qdd�S�)Nz*.repoc�����������������S���s���t�j�|�d�d���S�)N���)r����utilZ split_path)�xr���r���r����<lambda>5��������z%RepoReader.__iter__.<locals>.<lambda>)�keyz'Warning: failed loading '%s', skipping.)� _get_reposr���Zconfig_file_path�reposdir�glob�os�path�join�append�sortr���� exceptions�ConfigError�logger�warningr���)r ����rZrepo_configsr���r����repofnr���r���r����__iter__(���s���� �zRepoReader.__iter__c����������� ��� ���C���s`��t�jj�||�jj�}tj�|�}|durl||krJtd�� ||||�|�}ntd�� |||�|�}tj �|��tj�||�j�}z|� |||tjj��W�n\�ty��}�zD||kr�td�� |||�}ntd�� ||�}tj �|��W�Y�d}~n d}~0�0�|�d�tjjk�r:||k�r"td�� ||�}ntd�� |�}t�|��t|j�|_|j�|�jj��||_|S�) z)Build a repository using the parsed data.Nz&Bad id for repo: {} ({}), byte = {} {}z!Bad id for repo: {}, byte = {} {}z.Repository '{}' ({}): Error parsing config: {}z)Repository '{}': Error parsing config: {}�namez@Repository '{}' ({}) is missing name in configuration, using id.z;Repository '{}' is missing name in configuration, using id.)�libdnfr����ConfigParserZ substitute� substitutionsr����repoZrepo_id_invalidr����formatr���r���ZRepoZ _populateZPRIO_REPOCONFIG� ValueErrorZ _get_priorityZPRIO_DEFAULTr���r���r���r#���Z_substitutions�updateZcfg) r ����parserZid_r!���Zsubstituted_idZinvalid�msgr'����er���r���r����_build_repo?���s>����� �" � zRepoReader._build_repoc�����������������c���s(��|�j�j}tj����}|�|��z|�|��W�nh�tyf�}�z$tj� t d��||���W�Y�d}~n6d}~0��ty��}�zt �|��W�Y�d}~n d}~0�0�|���D�]�}|dkr�q�z|��|t|�|�}W�nH�tjjtjj f�y�}�z"t �|��W�Y�d}~q�W�Y�d}~nd}~0�0�||_|�|�j��|V��q�dS�)z4Parse and yield all repositories from a config file.zParsing file "{}" failed: {}N�main)r���r&���r$���r%���ZsetSubstitutions�read�RuntimeErrorr���r���r���r���r(����IOErrorr���r���ZgetDatar.���r���Z RepoErrorZrepofileZ_configure_from_optionsr ���)r ���r!���Zsubstsr+���r-����sectionZthisrepor���r���r���r���h���s(���� , "zRepoReader._get_reposN)�__name__� __module__�__qualname__r ���r"���r.���r���r���r���r���r���r���#���s���)r���)Z __future__r���r���Zdnf.i18nr���r���Zdnf.confr���Zlibdnf.confr$���Zdnf.exceptionsZdnf.repor���Zloggingr���Z getLoggerr����objectr���r���r���r���r����<module>���s���