Current File : //lib/python3.9/site-packages/dnf-plugins/__pycache__/repograph.cpython-39.pyc
a

�&c��@s^ddlmZddlmZddlmZmZddlZdZGdd�dej	�Z
Gdd	�d	ejj�Z
dS)
�)�absolute_import)�unicode_literals)�_�loggerNzY
size="20.69,25.52";
ratio="fill";
rankdir="TB";
orientation=port;
node[style="filled"];
cs eZdZdZ�fdd�Z�ZS)�	RepoGraph�	repographcs,tt|��||�|durdS|�t�dS�N)�superr�__init__Zregister_command�RepoGraphCommand)�self�base�cli��	__class__��9/usr/lib/python3.9/site-packages/dnf-plugins/repograph.pyr
)szRepoGraph.__init__)�__name__�
__module__�__qualname__�namer
�
__classcell__rrrrr%src@s<eZdZdZed�Zdd�Zdd�Zdd�Ze	d	d
��Z
dS)r)rz
repo-graphz4Output a full package dependency graph in dot formatcCsR|jj}d|_d|_|jjrN|jj��D]$}|j	|jjvrD|�
�q(|��q(dS)NT)r�demandsZsack_activationZavailable_reposZopts�repor
Zrepos�all�id�disable�enable)rrrrrr�	configure4s
zRepoGraphCommand.configurecCs|�t�dSr)�do_dot�
DOT_HEADER)rrrr�run?szRepoGraphCommand.runc	Cs�d}|�|jj�}td�td�|��|��D]�}t||�|krPt||�}ddt||�}|d}d}td�||||��td	�|��||D]}td
�|��q�td�|||��q0td�dS)
Nrzdigraph packages {z{}g�?g��s���?g�������?g�?z""{}" [color="{:.12g} {:.12g} {}"];z
"{}" -> {{z"{}"z!}} [color="{:.12g} {:.12g} {}"];
�})�	_get_depsr
�sack�print�format�keys�len)	r�headerZmaxdepsZdeps�pkg�h�s�b�reqrrrrBs zRepoGraphCommand.do_dotc
Cs�i}i}g}|����}|D]�}i}|jD]�}t|�}||vr@q*|�d�rLq*||vr^||}	n@|j|d�}	|	s�t�td�|�|�	|�q*n
|	dj
}	|	||<|	|j
kr�d||	<|	|vs*|	|vr�q*nd||	<|��||j
<q*q|S)Nz	solvable:)ZprovideszNothing provides: '%s'r)�query�	available�requires�str�
startswith�filterr�debugr�appendrr')
r$r1Zprov�skipr0r*�xxr.ZreqnameZproviderrrrr#Ys8





zRepoGraphCommand._get_depsN)rrr�aliasesrZsummaryrr!r�staticmethodr#rrrrr0sr)Z
__future__rrZdnfpluginscorerrZdnf.cliZdnfr ZPluginrrZCommandrrrrr�<module>s