ó ¾[/\c@s¯ddlmZddlmZmZddlmZddlmZddl m Z ddl Z ddl Z ddl Z ddlZddlZdejfd„ƒYZdS( iÿÿÿÿ(tprint_function(tcommandstCliError(t_(tNoModuleException(tloggerNt ModuleCommandc BsYeZdejfd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd „ƒYZd efd „ƒYZ d efd „ƒYZ defd„ƒYZ defd„ƒYZ defd„ƒYZ eeeee e e e e h ZehZdZedƒZd„Zd„Zd„Zd„Zd„Zd„ZRS(t SubCommandcBseZd„ZRS(cCs8ttj|ƒj|ƒtjjj|jƒ|_dS(N( tsuperRRt__init__tdnftmodulet module_baset ModuleBasetbase(tselftcli((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR %s(t__name__t __module__R (((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR#stListSubCommandcBs eZdZd„Zd„ZRS(tlistcCs"|jj}t|_t|_dS(N(RtdemandstTruetavailable_repostsack_activation(RR((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyt configure-s  cCs |j}|jjr9|j|jjtjjjƒ}n|jj ri|j|jjtjjj ƒ}nQ|jj r™|j|jjtjjj ƒ}n!|j|jjtjjj ƒ}|rÎt|ƒdStdƒ}|jjrûtjj|ƒ‚ntj|ƒdS(NsNo matching Modules to list(R toptstenabledt_get_brief_descriptiont module_spectlibdnfR tModulePackageContainertModuleState_ENABLEDtdisabledtModuleState_DISABLEDt installedtModuleState_INSTALLEDtModuleState_UNKNOWNtprintRR t exceptionstErrorRtwarning(Rtmodstoutputtmsg((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyt run_on_module2s*         (slist(RRtaliasesRR-(((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR)s tInfoSubCommandcBs eZdZd„Zd„ZRS(tinfocCs"|jj}t|_t|_dS(N(RRRRR(RR((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyROs  cCs•|jjr'|jj|jjƒ}n?|jjrN|jj|jjƒ}n|jj|jjƒ}|ryt|ƒnt j j t dƒƒ‚dS(NsNo matching Modules to list( RtverboseR t_get_full_infoRtprofilet_get_info_profilest _get_infoR&R R'R(R(RR+((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR-Ts   (sinfo(RRR.RR-(((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR/Ks tEnableSubCommandcBs eZdZd„Zd„ZRS(tenablecCs4|jj}t|_t|_t|_t|_dS(N(RRRRRt resolvingt root_user(RR((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyRds     cCs¨y|jj|jjƒWn‡tjjk r£}|jjj r|j sS|j r\|‚n|j r|j dt jjjkr|‚qntjt|ƒƒnXdS(Ni(R R7RRR R't MarkingErrorsRtconftstricttno_match_group_specsterror_group_specstmodule_debsolv_errorsRR Rt!ModuleErrorType_ERROR_IN_DEFAULTSRterrortstr(Rte((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR-ks  (senable(RRR.RR-(((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR6`s tDisableSubCommandcBs eZdZd„Zd„ZRS(tdisablecCs4|jj}t|_t|_t|_t|_dS(N(RRRRRR8R9(RR((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR{s     cCs¨y|jj|jjƒWn‡tjjk r£}|jjj r|j sS|j r\|‚n|j r|j dt jjjkr|‚qntjt|ƒƒnXdS(Ni(R RERRR R'R:RR;R<R=R>R?RR RR@RRARB(RRC((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR-‚s  (sdisable(RRR.RR-(((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyRDws tResetSubCommandcBs eZdZd„Zd„ZRS(tresetcCs4|jj}t|_t|_t|_t|_dS(N(RRRRRR8R9(RR((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR’s     cCsqy|jj|jjƒWnPtjjk rl}|jjj rV|j rV|‚qVnt j t |ƒƒnXdS(N(R RGRRR R'R:RR;R<R=RRARB(RRC((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR-™s  (sreset(RRR.RR-(((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyRFŽs tInstallSubCommandcBs eZdZd„Zd„ZRS(tinstallcCs4|jj}t|_t|_t|_t|_dS(N(RRRRRR8R9(RR((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR¦s     cCs†y&|jj|jj|jjjƒWnYtjj k r}|jjjrk|j s_|j rk|‚qknt j t|ƒƒnXdS(N(R RIRRRR;R<R R'R:R=R>RRARB(RRC((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR-­s& (sinstall(RRR.RR-(((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyRH¢s tUpdateSubCommandcBs eZdZd„Zd„ZRS(tupdatecCs4|jj}t|_t|_t|_t|_dS(N(RRRRRR8R9(RR((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyRºs     cCs:|jj|jjƒ}|r6tdj|ƒƒ‚ndS(Ns, (R tupgradeRRRtjoin(Rt module_specs((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR-Ás(supdate(RRR.RR-(((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyRJ¶s tRemoveSubCommandcBs eZdZd„Zd„ZRS(tremoveterasecCsF|jj}t|_t|_t|_t|_t|_t|_ dS(N( RRRt allow_erasingRtFalsetfresh_metadataR8R9R(RR((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyRÊs      cCsB|jj|jjƒ}|s"dStjtjjd|ƒƒdS(NR=( R RPRRRRAR R'R:(Rtskipped_groups((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR-Ós(sremoveRQ(RRR.RR-(((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyROÆs tProvidesSubCommandcBs eZdZd„Zd„ZRS(tprovidescCs"|jj}t|_t|_dS(N(RRRRR(RR((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyRÞs  cCs/|jj|jjƒ}|r+t|ƒndS(N(R t_what_providesRRR&(RR+((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR-ãs(RW(RRR.RR-(((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyRVÚs R sInteract with Modules.csOtt|ƒjˆƒ‡fd†|jDƒ}d|_d„|Dƒ|_dS(Nc3s|]}|ˆƒVqdS(N((t.0tsubcmd(R(s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pys óscSs)i|]}|jD]}||“qqS((R.(RYRZtalias((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pys ös (RRR tSUBCMDStNoneRZt_subcmd_name2obj(RRt subcmd_objs((Rs;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR ñs c Csóg|jD]}|jd^q }|jdddd|ƒ|jdddƒ|jƒ}|jdd d d d d tdƒƒ|jdd dd d d tdƒƒ|jdd dd d d tdƒƒ|jdd dd d d tdƒƒdS(NiRZtnargsitchoicesRt*s --enabledtdestRtactiont store_truethelpsshow only enabled moduless --disabledR!sshow only disabled moduless --installedR#sshow only installed moduless --profileR3sshow profile content(R\R.t add_argumenttadd_mutually_exclusive_groupR(RtparserRZtsubcommand_helptnarrows((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyt set_argparserøs #    cCsny|j|jjd|_Wn-ttfk rM|jjjƒt‚nX|j|j_|jjƒdS(Ni( R^RRZRtKeyErrorRt optparsert print_usageR(R((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR s cCs|jƒ|jjƒdS(N(tcheck_required_argumentRZR-(R((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pytruns cCs„g|jD]}|jD] }|^qq }|jjd|kr€|jjs€tdj|jjd|jjdƒƒ‚q€ndS(Nisdnf {} {}: too few arguments(tSUBCMDS_NOT_REQUIRED_ARGR.RRZRRtformattcommand(RRZR[tnot_required_argument((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyRps  cCs0|jjddkr,tjtdƒƒndS(NiR7sg Switching module streams does not alter installed packages (see 'module enable' in dnf(8) for details)(senable(RRZRR0R(R((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pytrun_transaction"s(smodule(RRRtCommandRRR/R6RDRFRHRJRORVR\RrR.RtsummaryR RlRRqRpRv(((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyR"s,"         (t __future__Rtdnf.cliRRtdnf.i18nRtdnf.module.exceptionsRtdnf.utilRtsystosRtdnf.module.module_baseR tdnf.exceptionsRwR(((s;/usr/lib/python2.7/site-packages/dnf/cli/commands/module.pyts