Anons79 Mini Shell

Directory : /usr/lib/python2.7/site-packages/dnf/conf/
Upload File :
Current File : //usr/lib/python2.7/site-packages/dnf/conf/config.pyo

�
�[/\c@@s�ddlmZddlmZddlmZddlmZmZddlm	Z	ddl
Z
ddlZddl
ZddlZddlZddlZddlZddlZddlZddlZddlZejjjZejjjZejjjZejjjZejjj Z!ejjj"Z#ejjj$Z%ejjj&Z'ejjj(Z)ej*d�Z+de,fd	��YZ-d
e,fd��YZdefd
��YZ.defd��YZ/defd��YZ0defd��YZ1defd��YZ2defd��YZ3defd��YZ4defd��YZ5de,fd��YZ6de6fd��YZ7d e6fd!��YZ8d"e6fd#��YZ9dS($i(tabsolute_import(tunicode_literals(tmisc(tucdt_(t
basestringNudnftValuecB@s eZdZd�Zd�ZRS(uEValue of an Option consists of an actual value and its priority.
    cC@s||_||_dS(N(tvaluetpriority(tselfRR((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt__init__7s	cC@sd|jj|j|jfS(Nu%s(value=%r, priority=%r)(t	__class__t__name__RR(R	((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt__repr__;s(Rt
__module__t__doc__R
R
(((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR4s	tOptioncB@s5eZdZd�Zd�Zd�Zed�ZRS(u� This class handles a single configuration file option.
        Create subclasses for each type of supported configuration option.
        Each option remembers its default value and can inherit from a parent
        option (e.g. repo.gpgcheck inherits from main.gpgcheck).
        Some options can may be runtimeonly which means they are not read from or
        written to config file.
    cC@s:t|tjj�r!||_ntjj|�|_dS(N(t
isinstancetlibdnftconfRt_optiontOptionString(R	toption((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR
HscC@s
|jj�S(uGet option's value.(RtgetValue(R	((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt_getNscC@s
|jj�S(uGet option's priority.(RtgetPriority(R	((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt
_get_priorityRscC@s:|dkr:y|jj||�Wq6tk
r6q6Xn�y�t|t�s[t|t�r}|jj|tjj	|��nnt|jtjj
�s�t|jtjj�r�t|t�r�|jj|t
|��n|jj||�WnGtk
r5}tjjtd�|t|�fdt|���nXdS(uRSet option's value if priority is equal or higher
           than curent priority.uError parsing '%s': %st	raw_errorN(tNoneRtsett	ExceptionRtlistttupleRRtVectorStringt
OptionBooltOptionChildBooltinttbooltRuntimeErrortdnft
exceptionstConfigErrorRtstr(R	RRte((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt_setVs"
"(RRRR
RRtPRIO_RUNTIMER,(((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR@s
			t	IntOptioncB@seZdd�ZRS(icC@s,tjj|�}tt|�j|�dS(N(RRtOptionNumberInt32tsuperR.R
(R	tdefaultR((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR
os(RRR
(((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR.nst
LongOptioncB@seZdd�ZRS(icC@s,tjj|�}tt|�j|�dS(N(RRtOptionNumberInt64R0R2R
(R	R1R((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR
us(RRR
(((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR2tst
BoolOptioncB@seZed�ZRS(cC@s,tjj|�}tt|�j|�dS(N(RRR"R0R4R
(R	R1R((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR
{s(RRtFalseR
(((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR4zstSelectionOptioncB@seZdZddd�ZRS(u=Handles string values where only specific values are allowed.cC@s;tjj|tjj|��}tt|�j|�dS(N(RRtOptionEnumStringR!R0R6R
(R	R1tchoicesR((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR
�s!N((RRRRR
(((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR6�st
ListOptioncB@seZdZdd�ZRS(u=Handles string values where only specific values are allowed.cC@s8tjjtjj|��}tt|�j|�dS(N(RRtOptionStringListR!R0R9R
(R	R1R((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR
�sN(RRRRR
(((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR9�st
SecondsOptioncB@seZdd�ZRS(icC@s,tjj|�}tt|�j|�dS(N(RRt
OptionSecondsR0R;R
(R	R1R((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR
�s(RRR
(((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR;�stStringOptioncB@seZdd�ZRS(ucC@s,tjj|�}tt|�j|�dS(N(RRRR0R=R
(R	R1R((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR
�s(RRR
(((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR=�st
PathOptioncB@seZdeed�ZRS(ucC@s2tjj|||�}tt|�j|�dS(N(RRt
OptionPathR0R>R
(R	R1texiststabsPathR((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR
�s(RRR5R
(((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR>�st
BaseConfigcB@s�eZdZdddd�Zd�Zd�Zd�Zd�Zd�Z	e
d�Zed�Z
d	�Zdd
d
�Zed��ZRS(ulBase class for storing configuration definitions.

       Subclass when creating your own definitions.

    cC@s#||jd<||_||_dS(Nu_config(t__dict__t_sectiont_parser(R	tconfigtsectiontparser((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR
�s
	cC@s�d|jkr-tdj|j|���nt|j|�}|dkrOdSy|�j�}Wntk
rx}dSXt	|t
�r�t|�S|S(Nu_configu!'{}' object has no attribute '{}'(RCtAttributeErrortformatRtgetattrt_configRRRRR*R(R	tnameRRtex((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt__getattr__�s
cC@s�t|j|d�}|dkr:tt|�j||�St|t�r^|j}|j	}nt
}|dkr�y|�j||�Wq�tk
r�q�Xn�y�t|t
�s�t|t�r�|�j|tjj|��nnt|�tjj�st|�tjj�r<t|t�r<|�j|t|��n|�j||�WnGtk
r�}tjjtd�|t|�fdt|���nXdS(NuError parsing '%s': %sR(RKRLRR0RBt__setattr__RRRRR-RRRR RRR!R"R#R$R%R&R'R(R)RR*(R	RMRRRR+((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyRP�s.	
"'cC@s�g}|jd|j�|jr�xa|jj�D]M}y|jj�}Wntk
red}nX|jd|j|f�q3Wndj|�S(Nu[%s]uu%s: %su
(	tappendRDRLtoptBindstsecondtgetValueStringR&tfirsttjoin(R	touttoptBindR((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt__str__�s	

!cC@s2t|j|d�}|dkr%dSt|��S(N(RKRLRR(R	RMtmethod((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt_get_option�scC@s)|j|�}|dkrdS|j�S(N(R[RR(R	RMtopt((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt
_get_value�scC@sB|j|�}|dkr2td|d��n|j||�S(NuOption udoes not exists(R[RRR,(R	RMRRR\((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt
_set_value�sc	C@sC|j|�r?x-|j�|D]}|j||�}|sK|dkrTd}nt|j|�r�y&|jj�j|�j||�Wq8tk
r�}t	j
td�t|�t|�t|�t
|��q8Xq |dkr
t||�r
t|||�q t	j
td�t|�t|�t|��q WndS(u+Set option values from an INI file section.uNoneuu,Unknown configuration value: %s=%s in %s; %suarchu+Unknown configuration option: %s = %s in %sN(t
hasSectiontgetDatatgetSubstitutedValuethasattrRLRRtatt	newStringR&tloggertdebugRRR*tsetattr(R	RHRGtfilenameRRMRR+((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt	_populate�s 	&/	cC@s�d|jg}|jrqxU|jj�D]A}y'|jd|j|jj�f�Wq)tk
riq)Xq)Wndj|�dS(u]Return a string representing the values of all the
           configuration options.
        u[%s]u%s = %su
(	RDRLRRRQRURSRTR&RV(R	toutputRX((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pytdump
s	'
cC@s�|dkr6|jdkr*td��n|j}n|jj|�}|jr�x~|jj�D]j}|dks�|j|ks�|jj	�t
ks�|j|kra|jj||j|jj��qaqaWn|jj
|�dS(u�Write out the configuration to a file-like object.

        :param fileobj: File-like object to write to
        :param section: Section name to use. If not specified, the section name
            used during parsing will be used
        :param always: A sequence of option names to always write out.
            Options not listed here will only be written out if they are at
            non-default values. Set to None to dump out all options
        u!not populated, don't know sectionN(RRDt
ValueErrorREtoptionsRLRRRURSRtPRIO_DEFAULTRRTtwrite(R	tfileobjRGtalwaystcfg_optionsRX((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt_writes	,c	C@s�t|��}tj|�}WdQX||krkx8|D]-}tjjj||�|kr7|}q7q7WnxI|j�D];\}}t|t	�r�dj
|�}n||||<qxWt|d��}|jt|��WdQXdS(u�
        filename   - name of config file (.conf or .repo)
        section_id - id of modified section (e.g. main, fedora, updates)
        substitutions - instance of base.conf.substitutions
        modify     - dict of modified options
        Nu uw(
topentiniparset	INIConfigRRtConfigParsert
substitutetitemsRRRVRoR*(	Rht
section_idt
substitutionstmodifytfptinitsectRMR((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pytwrite_raw_configfile9s	
N((RRRRR
RORPRYR[R]R-R^RnRiRkRststaticmethodR�(((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyRB�s						tMainConfcB@s�eZdZddd�Zed��Zd�Zd�Zd�Z	d�Z
d�Zd	�Zed
��Z
e
jd��Z
ed��Zejd
��Zed��Zejd��Zded�Zed��ZRS(u?Configuration option definitions for dnf.conf's [main] section.umaincC@s�tjj�}tt|�j|||�|jd�jtj	j
gt�|jd�jtj	jgt�tjj
j�|_
tj�|_|jj�jttj	j�tjj�r�tj	j}d}n]ytj�}}WnFttfk
r2}td�jt|��}tjj |��nX|jj!�jt|�|jj"�jt|�t#ddt$�|_%t#ddt$�|_&dS(Nu
pluginpathupluginconfpathu/var/loguCould not set cachedir: {}u/etc/dnf/modules.dRAu/etc/dnf/modules.defaults.d('RRt
ConfigMainR0R�R
R[R,R'tconstt
PLUGINPATHRntPLUGINCONFPATHR{t
Substitutionsthawkeytdetect_archtarchRLtsystem_cachedirRtSYSTEM_CACHEDIRtutilt	am_i_rootRtgetCacheDirtIOErrortOSErrorRRJRR(tErrortcachedirtlogdirR>tTruet
modulesdirtmoduledefaultsdir(R	RGRHRFR�R�R+tmsg((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR
Xs&""	cC@sld}x3|jd�D]"}tjj|�r|}PqqW|sh|jd�d}tjj|�n|S(uReturns the value of reposdirureposdiriN(RR]tostpathR@R'R�t
ensure_dir(R	t	myrepodirtrdir((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pytget_reposdirtsc@s��j|�}|j�}|tkr+dS|j�}t|t�s�t�fd�|D��r�|jtj	j
g|D]}�j|�^qx�|�q�nOtj
jtj
j�jd�|jd���r�|j�j|�|�ndS(Nc3@sB|]8}tjjtjj�jd�|jd���VqdS(uinstallrootu/N(R�R�R@RVR]tlstrip(t.0tp(R	(s3/usr/lib/python2.7/site-packages/dnf/conf/config.pys	<genexpr>�suinstallrootu/(R[RtPRIO_COMMANDLINERRR*tanyR,RRR!t_prepend_installroot_pathR�R�R@RVR]R�(R	toptnameR\tpriotvalR�((R	s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt_search_inside_installroot�s
1
cC@sD|j|�}|j�}|j|j��}|j||�dS(N(R[RR�RR,(R	R�R\R�tnew_path((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pytprepend_installroot�scC@s@tjj|jd�|jd��}tjjj||j	�S(Nuinstallrootu/(
R�R�RVR]R�RRRwRxR{(R	R�t	root_path((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR��s'c
C@s(ddddddddd	d
dddd
dddddddddddddg}x�|D]y}t||d!�}|d!k	r^|gkr^|j|�}|d!k	r�t}|jr�y"|jj�j|�j�}Wq�tk
r�q�Xn|rtt	j
j}||j�kr$|j�}nxc|D]B}|rW|j
|j�|g|�q+|j
gt	j
j�q+Wq�|j
|t	j
j�q�t||�r�t|||�q�tjtd�t|�t|��q^q^Wt|dd!�tkr|jd�}|j
tt	j
j�nt|d�r$x�|jj�D]�\}}	x�|	D]�}
t|j|�r�y&|jj�j|�jt|
�Wqtk
r�}t	jjtd�||
t|�fdt|���qXqMt||�r�t|||
�qMtd �}tj||�qMWq:Wnd!S("u%Configure parts of CLI from the opts upluginsuversionuconfig_file_pathu
debuglevelu
errorleveluinstallrootubestu	assumeyesuassumenouclean_requirements_on_removeugpgcheckushowdupesfromreposu
ip_resolveurpmverbosityudisable_excludesucolorudownloadonlyuexcludeuexcludepkgsuskip_brokenutsflagsuarchubasearchu
ignorearchu	cacheonlyucommentu%Unknown configuration option: %s = %sulocalpkg_gpgcheckumain_setoptsu4Error parsing --setopt with key '%s', value '%s': %sRu1Main config did not have a %s attr. before setoptN(RKRR[R5RLRRRctgetAddValueR&R'RR�RR,RRbRgRetwarningRRtmain_setoptsRyRdR(R)R*(
R	toptstconfig_argsRMRR\tappendValuetadd_prioritytitemtvaluesR�R+R�((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt_configure_from_options�s`				
	"

 
&		,cC@sxd}|dk	rt|gkrt|j|�}|rL|j|tjj�qttjtd�t	|�t	|��ndS(Nuexcludepkgsu%Unknown configuration option: %s = %s(
RR[R,R'RR�ReR�RR(R	tpkgsRMtconfopt((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pytexclude_pkgs�scC@sN|jd�}|j�}|rJ|jd�}|j||j��ndS(u Adjust conf options interactionsuskip_brokenustrictN(R[RR,R(R	tskip_brokentskip_broken_valtstrict((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt_adjust_conf_options�s
cC@s|jjd�S(Nu
releasever(R{tget(R	((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt
releasever�scC@s:|dkr#|jjdd�dSt|�|jd<dS(Nu
releasever(RR{tpopR*(R	R�((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR��scC@s|jjd�S(Nuarch(R{R�(R	((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR�scC@s�|dkr#|jjdd�dS|tjjj�krhtd�}tjj	|j
d|���n||jd<tjj|�|_dS(NuarchuIncorrect or unknown "{}": {}(RR{R�R'trpmt
_BASEARCH_MAPtkeysRR(R�RJtbasearch(R	R�R�((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR�	s!
cC@s|jjd�S(Nubasearch(R{R�(R	((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR�scC@sy|dkr#|jjdd�dS|tjjj�krhtd�}tjj	|j
d|���n||jd<dS(NubasearchuIncorrect or unknown "{}": {}(RR{R�R'R�R�R�RR(R�RJ(R	R�R�((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR�s!cC@s�|dkr|jd�}ntjj�|_y|jj|�WnTtk
r{}tj	j
td�||f��n tk
r�}t
j|�nX|j|j|j||�|jd||�dS(Nuconfig_file_pathuParsing file "%s" failed: %s(RR]RRRwREtreadR&R'R(R)RR�ReR�RiRDR^(R	RhRR+((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR�'s%cC@s|jd�tjjkS(Nu
debuglevel(R]R'R�t
VERBOSE_LEVEL(R	((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pytverbose7sN(RRRRR
tpropertyR�R�R�R�R�R�R�R�tsetterR�R�RnR�R�(((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR�Us"				A			
tRepoConfcB@s&eZdZddd�Zd�ZRS(u4Option definitions for repository INI file sections.cC@sett|�jtjj|r'|jntjj��||�|rO|jntjj�|_dS(N(	R0R�R
RRt
ConfigRepoRLR�t
_masterConfig(R	tparentRGRH((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR
?s(c	C@sjt|dd�tkrWx<ddgD]+}|j|�}|jttjj�q%Wnt|di�}|j|krf||jj	�}x�|D]�\}}x�|D]�}t
|j|�r9y&|jj�j
|�jt|�Wq[tk
r5}	tjjtd�|j||t|	�fdt|	���q[Xq�td�}
tj|
|j|�q�Wq�WndS(uConfigure repos from the opts. ugpgchecku
repo_gpgcheckurepo_setoptsu7Error parsing --setopt with key '%s.%s', value '%s': %sRu-Repo %s did not have a %s attr. before setoptN(RKRR5R[R,R'RR�RDRyRbRLRRRcRdR&R(R)RR*ReR�(R	R�R�R\trepo_setoptstsetoptsRMR�R�R+R�((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR�Ds$
&		2N(RRRRR
R�(((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR�<st
ModuleConfcB@s&eZdZddd�Zd�ZRS(u0Option definitions for module INI file sections.cC@sqd}tt|�j|||�t|�|_td�|_tg�|_t	t
�|_td�|_dS(Nu(
RR0R�R
R=RMtstreamR9tprofilesR4R5tenabledtstate(R	RGRHRF((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR
cscC@s�|jj�dkr7|jj�r7|jjd�ndj|j�}|dj|jj��7}|dj|jj��7}|djdj|j	j���7}|dj|jj��7}|j
|�dS(	Nuuenabledu[{}]
u
name = {}
ustream = {}
uprofiles = {}
u,ustate = {}
(R�RR�R,RJRDRMR�RVR�Ro(R	RpRj((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyRsos$%N(RRRRR
Rs(((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyR�`s(:t
__future__RRtdnf.yumRtdnf.i18nRRt
dnf.pycompRtcopytdnf.conf.substitutionsR't	dnf.consttdnf.exceptionstdnf.utilR�RutloggingR�tlibdnf.confRRRtPriority_EMPTYt
PRIO_EMPTYtPriority_DEFAULTRntPriority_MAINCONFIGtPRIO_MAINCONFIGtPriority_AUTOMATICCONFIGtPRIO_AUTOMATICCONFIGtPriority_REPOCONFIGtPRIO_REPOCONFIGtPriority_PLUGINDEFAULTtPRIO_PLUGINDEFAULTtPriority_PLUGINCONFIGtPRIO_PLUGINCONFIGtPriority_COMMANDLINER�tPriority_RUNTIMER-t	getLoggerRetobjectRR.R2R4R6R9R;R=R>RBR�R�R�(((s3/usr/lib/python2.7/site-packages/dnf/conf/config.pyt<module>sN.��$

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]