3 ft`s @s`ddlmZddlmZddlmZddlmZddlZddl Z e j dZ Gdddej Z dS) )absolute_import)unicode_literals)_)commandsNdnfc@sLeZdZdZdZedjejj dZ e ddZ ddZ d d Zd d Zd S) SwapCommandzNA class containing methods needed by the cli to execute the swap command. swapz=run an interactive {prog} mod for remove and install one spec)progcCs,|jddtdd|jddtdddS)N remove_specZstorezThe specs that will be removed)actionhelp install_specz The specs that will be installed) add_argumentr)parserr/usr/lib/python3.6/swap.py set_argparser&s zSwapCommand.set_argparsercCsH|jj}d|_d|_d|_d|_tj|j|jtj |j|j j gdS)NT) clidemandsZsack_activationZavailable_reposZ resolvingZ root_userrZ _checkGPGKeybaseZ_checkEnabledRepooptsr )selfrrrr configure,szSwapCommand.configurecCs@|jjj|}|dk r<||j}|jjj|||g|jdS)N)rZ cli_commandsgetZ optparserZparse_command_argsrun)rZcmd_strspecZcmd_clscmdrrr_perform5s  zSwapCommand._performcCs$|jd|jj|jd|jjdS)NremoveZinstall)rrr r )rrrrr<szSwapCommand.runN)r)__name__ __module__ __qualname____doc__aliasesrformatrutilZMAIN_PROG_UPPERZsummary staticmethodrrrrrrrrrs   r)Z __future__rrZdnf.i18nrZdnf.clirZdnf.utilrZloggingZ getLoggerZloggerZCommandrrrrrs