a
    !cA
                     @   s`   d dl mZ d dl mZ d dlmZ d dlmZ d dlZd dl	Z	e	
dZG dd dejZdS )	    )absolute_import)unicode_literals)_)commandsNdnfc                   @   sL   e Zd ZdZdZedjejj	dZ
edd Zdd Zd	d
 Zdd ZdS )SwapCommandzNA class containing methods needed by the cli to execute the swap command.
    )Zswapz=run an interactive {prog} mod for remove and install one spec)progc                 C   s,   | j ddtdd | j ddtdd d S )Nremove_specZstorezThe specs that will be removed)actionhelpinstall_specz The specs that will be installed)add_argumentr   )parser r   9/usr/lib/python3.9/site-packages/dnf/cli/commands/swap.pyset_argparser&   s    
zSwapCommand.set_argparserc                 C   sH   | j j}d|_d|_d|_d|_t| j| j  t	| j| j
jg d S )NT)clidemandsZsack_activationZavailable_reposZ	resolvingZ	root_userr   Z_checkGPGKeybaseZ_checkEnabledRepooptsr   )selfr   r   r   r   	configure,   s    zSwapCommand.configurec                 C   s@   | j j|}|d ur<|| j }| j j|||g |  d S )N)r   Zcli_commandsgetZ	optparserZparse_command_argsrun)r   Zcmd_strspecZcmd_clscmdr   r   r   _perform5   s
    
zSwapCommand._performc                 C   s$   |  d| jj |  d| jj d S )NZinstallremove)r   r   r   r	   )r   r   r   r   r   <   s    zSwapCommand.runN)__name__
__module____qualname____doc__aliasesr   formatr   utilZMAIN_PROG_UPPERZsummarystaticmethodr   r   r   r   r   r   r   r   r      s   
	r   )Z
__future__r   r   Zdnf.i18nr   Zdnf.clir   Zdnf.utilr   ZloggingZ	getLoggerZloggerZCommandr   r   r   r   r   <module>   s   
