404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.16.47.126: ~ $
3

�ft`4]�@s�ddlmZddlmZddlmZddlZddlZddlZddl	Zddl
ZddlZddlZ
ddlZddlZejd�ZGdd�dej�ZGdd	�d	ej�ZdS)
�)�unicode_literals)�_)�_parse_specsN�dnfcseZdZ�fdd�Z�ZS)�MultilineHelpFormattercs"d|kr|j�Stt|�j||�S)N�
)�
splitlines�superr�_split_lines)�self�text�width)�	__class__��#/usr/lib/python3.6/option_parser.pyr
'sz#MultilineHelpFormatter._split_lines)�__name__�
__module__�__qualname__r
�
__classcell__rr)rrr&srcseZdZdZd.�fdd�	Zdd�ZGdd�dej�ZGd	d
�d
ej�Z	Gdd�dej
�ZGd
d�dej�ZGdd�dej�Z
Gdd�dej�ZGdd�dej�ZGdd�dej�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd/�fd*d+�	Zd0�fd,d-�	Z�ZS)1�OptionParserz5ArgumentParser like class to do things the "yum way".Tcs>tt|�jdtd�d|_d|_|j�|r:i|_t�|_	dS)NF)�add_helpZformatter_class)
r	r�__init__r�command_positional_parser�
command_group�_add_general_options�
_cmd_usage�set�_cmd_groups)rZreset_usage)rrrr/szOptionParser.__init__cCs&|j�tjtd�|�tjd�dS)z�Output an error message, and exit the program.
           This method overrides standard argparser's error
           so that error output goes to the logger.

        :param msg: the error message to output
        zCommand line error: %s�N)�print_usage�loggerZcriticalr�sys�exit)r�msgrrr�error9szOptionParser.errorc@seZdZdd�ZdS)zOptionParser._RepoCallbackcs@|dkrdnd�t||j�}|j�fdd�tjd|�D��dS)Nz
--disablerepo�disable�enablec3s|]}|�fVqdS)Nr)�.0�x)�	operationrr�	<genexpr>Hsz6OptionParser._RepoCallback.__call__.<locals>.<genexpr>z\s*[,\s]\s*)�getattr�dest�extend�re�split)r�parser�	namespace�values�opt_str�lr)r)r�__call__Esz#OptionParser._RepoCallback.__call__N)rrrr5rrrr�
_RepoCallbackDsr6c@seZdZdd�ZdS)z OptionParser._RepoCallbackEnablecCs$|jj|ddf�t|d|�dS)Nrr&Zreponame)�repos_ed�append�setattr)rr0r1r2r3rrrr5Ksz)OptionParser._RepoCallbackEnable.__call__N)rrrr5rrrr�_RepoCallbackEnableJsr:cs$eZdZdZdZ�fdd�Z�ZS)zOptionParser._SplitCallbackzN Split all strings in seq, at "," and whitespace.
        Returns a new list. z\s*[,\s]\s*csDd}x:tj|j|�D](}|s |r8ttj|�j||||�d}qWdS)NTF)r.r/�SPLITTERr	r�_SplitCallbackr5)rr0r1r2r3�first�val)rrrr5Tsz$OptionParser._SplitCallback.__call__)rrr�__doc__r;r5rrr)rrr<Osr<c@seZdZdZdd�ZdS)z%OptionParser._SplitExtendDictCallbackz[ Split string at "," or whitespace to (key, value).
        Extends dict with {key: value}.c	Cshy"|jd�\}}|s|r t�Wn,tk
rNtd�|}tj||��YnXt||j�}|||<dS)N�,zbad format: %s)r/�
ValueErrorr�argparseZ
ArgumentErrorr+r,)	rr0r1r2r3�keyr>r#Zdctrrrr5bsz.OptionParser._SplitExtendDictCallback.__call__N)rrrr?r5rrrr�_SplitExtendDictCallback_srDc@seZdZdZdd�ZdS)zOptionParser._SetoptsCallbackzY Parse setopts arguments and put them into main_<setopts>
            and repo_<setopts>.cCs|jd�}t|�dkr*tjtd�|�dSt|�dkrJtjtd�|�dS|\}}|jd�}|dkr�|d|�}	||dd�}t|d�r�|j}
ni}
|
j|	i�j|g�j	|�t
|d|j|
�n:t|d	�r�|j}ni}|j|g�j	|�t
|d
|j|�dS)N�=�z'Setopt argument has multiple values: %sz Setopt argument has no value: %s�.r�repo_setoptsZrepo_�main_setoptsZmain_���)
r/�lenr Zwarningr�rfind�hasattrrH�
setdefaultr8r9r,rI)rr0r1r2r3�vals�k�vZperiod�repoZrepooptsZmainoptsrrrr5ps,



z&OptionParser._SetoptsCallback.__call__N)rrrr?r5rrrr�_SetoptsCallbackmsrSc@seZdZdd�ZdS)z'OptionParser.ParseSpecGroupFileCallbackcCst||�dS)N)r)rr0r1r2r3rrrr5�sz0OptionParser.ParseSpecGroupFileCallback.__call__N)rrrr5rrrr�ParseSpecGroupFileCallback�srTcs$eZdZ�fdd�Zdd�Z�ZS)zOptionParser.PkgNarrowCallbackcs�i|_y&x dD]}|||j|<||=qWWn6tk
rb}ztd|jj|f��WYdd}~XnXg|d<ttj|�j||�dS)N�choices�defaultz"%s() missing mandatory argument %s)rUrV)	�	pkgnarrow�KeyError�	TypeErrorrrr	r�PkgNarrowCallbackr)r�args�kwargsrP�e)rrrr�s
"z'OptionParser.PkgNarrowCallback.__init__cCsV|jd}|s"|d|jdkr.|jd}n
|jd�}t|||�t||j|�dS)NZ_actionrrUrV)r,rW�popr9)rr0r1r2r3Zdest_actionZnarrowrrrr5�s

z'OptionParser.PkgNarrowCallback.__call__)rrrrr5rrr)rrrZ�srZc@seZdZdd�ZdS)zOptionParser.ForceArchActioncCsd|_||_dS)NT)Z
ignorearchZarch)rr0r1r2r3rrrr5�sz%OptionParser.ForceArchAction.__call__N)rrrr5rrrr�ForceArchAction�sr_c
Cs�|jtdjtjjd���}|jdddddtd�d	�|jd
ddd
dtd�d�|jddd
dtd�d�|jdd
dtd�jtjjd�d�|jdtd�dd�|jdddgdtd�d�|jd d!dd"td#�d$�|jd%d&g|jtd'�d(d)�|jd*d+g|jtd,�d(d)�|jd-dtd.�d/�|jd0d1g|jtd2�d3�|jd4d5d
dtd6�d�|jd7d8d9d
d:td;�d<�|jd=d
dtd>�d�|j	�}|jd?d@d
dAdtdB�dC�|jdDd!dAtdE�d<�|jdFdGdHd
dtdI�d�|jdJdKdLt
ddMtdN�dO�|jdPdQdRdSdtdT�t
dU�|jdVd
dtdW�d�|jdXdYd
dtdZ�d�|jd[d\dt
td]�d^�|jd_dd`d
tda�jtjjd�db�|jdcdtdd�dedf�|jdgdhd
dtdi�d�|jdjd
dtdk�d�|jdl|jdmgdntdo�dp�|j	�}|jdq|jdmgdntdr�dp�|jdsdtdndu|jgtdv�dw�|j	�}|jdxdydzd
td{�db�|jd|dyd}d
td~�db�|jdd�d�gd�|jtd��d�d��|jd�d�gd�|jtd��dnd��|jd�i|j
d�td��d��|jd�d!dd�td��d$�|jd�d!dd�td��d$�|jd�d�dtd��d��|jd�d�d
td��d��|jd�d�dtd��dd�d��|jd�d�dtd��dd�d��|jd�d�d�dtd��d��|jd�d�d
dytd��d�|jd�d�dtd��d��|jd�d
td��d��|jd�d
td��d��|jd�d
td��d��|jd�d
td��d��|jd�d�d�g|jtd��d3�|jd�d�gd�|jtd��db�|jd�d�gd�|jtdƒdb�|jd�d�d�d�d�d�ggd�|jtdʃdˍ|jd�d�tj|jttjjj��td΃dύ|jd�d�tjdҍdS)�z0 Standard options known to all dnf subcommands. zGeneral {prog} options)�progz-cz--configZconfig_file_pathNz
[config file]zconfig file location)r,rV�metavar�helpz-qz--quiet�quiet�
store_truezquiet operation)r,�actionrVrbz-vz	--verbosezverbose operation)rerVrbz	--versionzshow {prog} version and exitz
--installrootzset install rootz[path])rbraz--nodocs�store_constZnodocsZtsflagszdo not install documentations)re�constr,rbz--nopluginsZstore_falseZpluginszdisable all plugins)rerVr,rbz--enablepluginZenablepluginzenable plugins by namez[plugin])r,rVrerbraz--disablepluginZ
disablepluginzdisable plugins by namez--releaseverz:override the value of $releasever in config and repo files)rVrbz--setoptZsetoptsz%set arbitrary config and repo options)r,rVrerbz
--skip-brokenZskip_brokenz.resolve depsolve problems by skipping packagesz-hz--helpz
--help-cmdrbzshow command help)rer,rbz--allowerasingz;allow erasing of installed packages to resolve dependenciesz-bz--bestZbestz8try the best available package versions in transactions.)rer,rVrbz--nobestz2do not limit the transaction to the best candidatez-Cz--cacheonlyZ	cacheonlyz2run entirely from system cache, don't update cachez-Rz--randomwaitZ	sleeptimez	[minutes]zmaximum command wait time)r,�typerVrarbz-dz--debuglevelZ
debuglevelz
[debug level]zdebugging output level)r,rarVrbrhz
--debugsolverz)dumps detailed solving results into filesz--showduplicatesZshowdupesfromreposz2show duplicates, in repos, in list/search commandsz-ez--errorlevelzerror output level)rVrhrbz--obsoletesZ	obsoletesz�enables {prog}'s obsoletes processing logic for upgrade or display capabilities that the package obsoletes for info, list and repoquery)rVr,rerbz--rpmverbosityzdebugging output level for rpmz[debug level name])rVrbraz-yz--assumeyesz*automatically answer yes for all questionsz
--assumenoz)automatically answer no for all questionsz--enablerepor7z[repo]z]Enable additional repositories. List option. Supports globs, can be specified multiple times.)rer,rVrarbz
--disablerepozSDisable repositories. List option. Supports globs, can be specified multiple times.z--repoz--repoidrRzUenable just specific repositories by an id or a glob, can be specified multiple times)rar,rerVrbz--enableFZset_enabledz>enable repos with config-manager command (automatically saves)z	--disableZset_disabledz?disable repos with config-manager command (automatically saves)z-xz	--excludez
--excludepkgsZexcludepkgsz exclude packages by name or globz	[package])rVr,rerbraz--disableexcludesz--disableexcludepkgsZdisable_excludeszdisable excludepkgsz--repofrompathz[repo,path]zolabel and path to an additional repository to use (same path as in a baseurl), can be specified multiple times.)rVrerarbz--noautoremoveZclean_requirements_on_removez7disable removal of dependencies that are no longer usedz--nogpgcheckZgpgcheckz5disable gpg signature checking (if RPM policy allows)z--colorZcolorzcontrol whether color is used)r,rVrbz	--refreshZfreshest_metadataz2set metadata as expired before running the command)r,rerbz-4Z
ip_resolvezresolve to IPv4 addresses onlyZipv4)r,rVrbrergz-6zresolve to IPv6 addresses onlyZipv6z	--destdirz
--downloaddirZdestdirz!set directory to copy packages toz--downloadonlyZdownloadonlyzonly download packagesz	--commentZcommentzadd a comment to transactionz--bugfixz,Include bugfix relevant packages, in updates)rerbz
--enhancementz1Include enhancement relevant packages, in updatesz--newpackagez0Include newpackage relevant packages, in updatesz
--securityz.Include security relevant packages, in updatesz
--advisoryz--advisoriesZadvisoryz=Include packages needed to fix the given advisory, in updatesz--bzz--bzsZbugzillaz7Include packages needed to fix the given BZ, in updatesz--cvez--cvesZcvesz8Include packages needed to fix the given CVE, in updatesz--sec-severityz
--secseverityZCriticalZ	ImportantZModerateZLowZseverityzDInclude security relevant packages matching the severity, in updates)rUrVr,rerbz--forcearchZARCHz Force the use of an architecture)rar,rerUrb�command�?)�nargsrb)�add_argument_groupr�formatr�utilZMAIN_PROG_UPPER�add_argumentr<rSZadd_mutually_exclusive_group�int�	MAIN_PROGr6rDrBZSUPPRESSr_�sortedZrpmZ
_BASEARCH_MAP�keys)rZgeneral_grpZ
best_groupZ
repo_groupZenable_grouprrrr�s:























z!OptionParser._add_general_optionscCsHtjj|j�}tjj|jd�}||jkrD||f|j|<|jj|�dS)z- store usage info about a single dnf command.rN)rZi18nZucd�summary�aliasesrr�add)r�cmd�grouprt�namerrr�_add_cmd_usageds

zOptionParser._add_cmd_usagecCs&x t|j��D]}|j||�qWdS)z� store name & summary for dnf commands

        The stored information is used build usage information
        grouped by build-in & plugin commands.
        N)rr2rz)rZcli_cmdsrxrwrrr�add_commandslszOptionParser.add_commandscCs�td�td�d�}dtjj}xfd	D]^}||jkr4q$|d||7}x<t|jj��D]*}|j|\}}||krT|d||f7}qTWq$W|S)
z- get the usage information to show the user. zList of Main Commands:zList of Plugin Commands:)�main�pluginz%s [options] COMMAND
r|r}z
%s

z	%-25s %s
)r|r})rrrnrqrrrrrs)rZdesc�usageZgrpryrxrtrrr�	get_usageus

zOptionParser.get_usagecCs~dtjj|jf|_|j|_tj|jdd�|_	|j
|j	_
d|j	j_|j
dj|jj���|_|j|j_|j|j_|j|j�dS)Nz%s %sF)rz{} command-specific options)rrnrq�_basecmdr`rt�descriptionrB�ArgumentParserrr�_positionals�titlerlrm�
capitalizer�cmd_add_argumentro�_commandZ
set_argparser)rrirrr�_add_command_options�s



z!OptionParser._add_command_optionscsBt�fdd�|D��r0t�j�j�jf|�|�S�jj||�SdS)Ncsg|]}|d�jk�qS)r)Zprefix_chars)r'�arg)rrr�
<listcomp>�sz1OptionParser.cmd_add_argument.<locals>.<listcomp>)�allrhrror)rr[r\r)rrr��szOptionParser.cmd_add_argumentcCs`xZ|D]R}y|jd�Wqtk
rV}z"tjjtd�|t|�f��WYdd}~XqXqWdS)Nzutf-8zCannot encode argument '%s': %s)�encode�UnicodeEncodeErrorr�
exceptionsZConfigErrorr�str)rr[r�r]rrr�_check_encoding�s
zOptionParser._check_encodingcCs|j|�|j|�\}}|S)N)r��parse_known_args)rr[r1Z_unused_argsrrr�parse_main_args�s
zOptionParser.parse_main_argscCs2|j|�|j|�\}}|jj||�}||_|jS)N)r�r�r�
parse_argsZopts)rrir[r1Zunused_argsrrr�parse_command_args�s

zOptionParser.parse_command_argsNcs,|jr|j|jj7_tt|�j|�dS)N)r�_actionsr	rr)rZfile_)rrrr�szOptionParser.print_usagecsd|rH|js|jj|jkr$|j|�|j|jj7_|jj|jj�n
|j	�|_
tt|�j
�dS)N)rr�r�r�r�rZ_action_groupsr8r�rr~r	r�
print_help)rri)rrrr��s

zOptionParser.print_help)T)N)N)rrrr?rr$rBZActionr6r:Z
_AppendActionr<rDrSrTrZr_rrzr{rr�r�r�r�r�rr�rrr)rrr,s.
;	r)Z
__future__rZdnf.i18nrZdnf.utilrrBZdnf.exceptionsrZdnf.rpmZdnf.yum.miscZloggingZos.path�osr.r!Z	getLoggerr Z
HelpFormatterrr�rrrrr�<module>s


Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 493 B 0644
__init__.cpython-36.pyc File 493 B 0644
aliases.cpython-36.opt-1.pyc File 5.31 KB 0644
aliases.cpython-36.pyc File 5.31 KB 0644
cli.cpython-36.opt-1.pyc File 30.1 KB 0644
cli.cpython-36.pyc File 30.13 KB 0644
completion_helper.cpython-36.opt-1.pyc File 8.46 KB 0644
completion_helper.cpython-36.pyc File 8.46 KB 0644
demand.cpython-36.opt-1.pyc File 1.51 KB 0644
demand.cpython-36.pyc File 1.51 KB 0644
format.cpython-36.opt-1.pyc File 2.3 KB 0644
format.cpython-36.pyc File 2.3 KB 0644
main.cpython-36.opt-1.pyc File 5.16 KB 0644
main.cpython-36.pyc File 5.16 KB 0644
option_parser.cpython-36.opt-1.pyc File 16.42 KB 0644
option_parser.cpython-36.pyc File 16.42 KB 0644
output.cpython-36.opt-1.pyc File 55.45 KB 0644
output.cpython-36.pyc File 55.54 KB 0644
progress.cpython-36.opt-1.pyc File 4.5 KB 0644
progress.cpython-36.pyc File 4.5 KB 0644
term.cpython-36.opt-1.pyc File 11.5 KB 0644
term.cpython-36.pyc File 11.53 KB 0644
utils.cpython-36.opt-1.pyc File 3.09 KB 0644
utils.cpython-36.pyc File 3.09 KB 0644