MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /proc/self/root/proc/self/root/usr/lib/python2.4/site-packages/yum/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/proc/self/root/usr/lib/python2.4/site-packages/yum/config.pyo
m
ODc@sdkZdkZdkZdkZdkZdkZdklZlZdk	l
Z
lZdkZ
dkZ
dkZdklZdefdYZdefdYZdZd	efd
YZdefdYZd
efdYZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZ de fd YZ!d!efd"YZ"d#Z#d$Z$d%Z%d&Z&d'Z'dS((N(sIncludingConfigParsersIncludedDirConfigParser(sNoSectionErrors
NoOptionError(s
Repositoryt
OptionDatacBstZdZdZRS(sC
    Simple class to track state for a single option instance.
    cCs(||_||_d|_d|_dS(N(tnametselft
initial_valuetvaluetNonetparsertsection(RRR((t./usr/lib/python2.4/site-packages/yum/config.pyt__init__#s			(t__name__t
__module__t__doc__R	(((RRstOptioncBsbtZdZedZdZdZdZdZdZ	dZ
dZd	ZRS(
s
    This class handles a single Yum configuration file option. Create
    subclasses for each type of supported configuration option.
    
    Python descriptor foo (__get__ and __set__) is used to make option
    definition easy and consise.
    cCs |it|_||_dS(N(Rt_setattrnametFalsetinherittdefault(RR((RR	2s
	cCsdt||_dS(smCalculate the internal attribute name used to store option state in
        configuration instances.
        s__opt%dN(tidRt	_attrname(R((RR7scCsJ|djo|Snt||id}|djodSn|iSdS(sCCalled when the option is read (via the descriptor protocol). 

        @param obj: The configuration instance to modify.
        @param objtype: The type of the config instance (not used).
        @return: The parsed option value or the default value if the value
            wasn't set in the configuration file.
        N(tobjRRtgetattrRtoptdataR(RRtobjtypeR((Rt__get__=s

cCst||i}t|toNy|i|}Wqpt	j
o(}t	d|it|fqpXn||_|i
djo/|i|}|i
i|i|i|ndS(sCalled when the option is set (via the descriptor protocol). 

        @param obj: The configuration instance to modify.
        @param value: The value to set the option to.
        @return: Nothing.
        sError parsing %r: %sN(RRRRRt
isinstanceRt
basestringtparset
ValueErrorteRtstrRRttostringtstrvaluetsetR(RRRRR R((Rt__set__Ms(	cCs#t||it||idS(sInitialise the option for a config instance. 
        This must be called before the option can be set or retrieved. 

        @param obj: BaseConfig (or subclass) instance.
        @param name: Name of the option.
        N(tsetattrRRRRRR(RRR((RtsetupfscCs(t||i}||_||_dS(s[Set the configuration parser for this option. This is required so
        that options can be written back to a configuration file.

        @param obj: BaseConfig (or subclass) instance.
        @param parser: ConfigParser (or subclass) where the option is read from.
        @param section: config file section where the option is from.
        N(RRRRRRR(RRRRR((Rt	setparseros	cCsti|}|i|S(s3Return a safe copy of this Option instance
        N(tcopyRtnewR(RR'((Rtclone{s
cCs|S(sParse the string value to the Option's native value.

        @param s: Raw string value to parse.
        @return: Validated native value.
    
        Will raise ValueError if there was a problem parsing the string.
        Subclasses should override this.
        N(ts(RR)((RRscCs
t|S(sConvert the Option's native value to a string value.

        @param value: Native option value.
        @return: String representation of input.

        This does the opposite of the parse() method above.
        Subclasses should override this.
        N(RR(RR((RRs(
R
RRRR	RRR"R$R%R(RR(((RR
)s								cCs|i}t|_|S(s]Clone an Option instance for the purposes of inheritance. The returned
    instance has all the same properties as the input Option and shares items
    such as the default value. Use this to avoid redefinition of reused
    options.

    @param option_obj: Option instance to inherit.
    @return: New Option instance inherited from the input.
    N(t
option_objR(t
new_optiontTrueR(R*R+((RtInherits	t
ListOptioncBs&tZddZdZdZRS(NcCs1|djo
g}ntt|i|dS(N(RRtsuperR.RR	(RR((RR	s

cCs.|idd}|idd}|iS(sConverts a string from the config file to a workable list

        Commas and spaces are used as separators for the list
        s
t t,N(R)treplacetsplit(RR)((RRscCs
di|S(Ns
 (tjoinR(RR((RRs(R
RRR	RR(((RR.s	t	UrlOptioncBs2tZdZededZdZdZRS(	sN
    This option handles lists of URLs with validation of the URL scheme.
    thttptftptfilethttpscCs,tt|i|||_||_dS(N(R/R5RR	Rtschemest
allow_none(RRR:R;((RR	s	cCs|i}|idjo"|iodSqAtdnti|\}}}}}}||ijo td|i|fn|S(Nt_none_s"_none_" is not a valid valuesURL must be %s not "%s"(turltstriptlowerRR;RRturlparseR)tbtptqtftoR:t_schemelist(RR=RARDRERCRBR)((RRs
! cCslt|idjodSnKt|idjo|idSn&ddi|id |idfSdS(s;Return a user friendly list of the allowed schemes
        itemptyis%s or %ss, iN(tlenRR:R4(R((RRFs(R6R7sfileR9(R
RRRRR	RRF(((RR5s	t
UrlListOptioncBs&tZdZeddZdZRS(sN
    Option for handling lists of URLs with validation of the URL scheme.
    R6R7R8R9cCs,tt|i|td||_dS(NR:(R/RIRR	RR5R:t
_urloption(RRR:((RR	scCsFg}x9tt|i|D]}|i|ii|qW|S(N(	toutR/RIRRR)R=tappendRJ(RR)R=RK((RRs
(shttpsftpsfileshttps(R
RRRR	R(((RRIst	IntOptioncBstZdZRS(NcCs<yt|SWn'ttfj
o}tdnXdS(Nsinvalid integer value(tintR)Rt	TypeErrorR(RR)R((RRs(R
RR(((RRMst
BoolOptioncBstZdZdZRS(NcCsF|i}|djotSn"|d	jotSn
tddS(
Nt0tnotfalset1tyesttruesinvalid boolean value(RQRRRS(RTRURV(R)R?RR,R(RR)((RRs

cCs|odSndSdS(NRURR(R(RR((RRs(R
RRR(((RRPs		tFloatOptioncBstZdZRS(NcCs@yt|iSWn%ttfj
otdnXdS(Nsinvalid float value(tfloatR)R>RRO(RR)((RR
s(R
RR(((RRW	stSelectionOptioncBs&tZdZefdZdZRS(sAHandles string values where only specific values are allowed
    cCs#tt|i|||_dS(N(R/RYRR	Rtallowedt_allowed(RRRZ((RR	scCs(||ijotd|n|S(Ns"%s" is not an allowed value(R)RR[R(RR)((RRs(R
RRRR	R(((RRYstBytesOptioncBs>tZhdd<ddd<dddd<ZdZRS(NtkitmtgcCst|djotdn|dioN|d }|di}|ii	|d}|ptd|qn
|}d}yt|}Wn#tj
otd|nX|djotdnt
||S(	sParse a friendly bandwidth option to bytes

        The input should be a string containing a (possibly floating point)
        number followed by an optional single character unit. Valid units are
        'k', 'M', 'G'. Case is ignored.
       
        Valid inputs: 100, 123M, 45.6k, 12.4G, 100K, 786.3, 0
        Invalid inputs: -10, -0.1, 45.6L, 123Mb

        Return value will always be an integer

        1k = 1024 bytes.

        ValueError will be raised if the option couldn't be parsed.
        isno value specifiedisunknown unit '%s'scouldn't convert '%s' to numberisbytes value may not be negativeN(RHR)RtisalphatnR?tunitRtMULTStgetRtmultRXRN(RR)RaReRb((RR%s$

(R
RRcR(((RR\s-tThrottleOptioncBstZdZRS(NcCst|djotdn|ddjov|d }yt|}Wn#tj
otd|nX|djp
|djotdn|d	Snti||Sd
S(sGet a throttle option. 

        Input may either be a percentage or a "friendly bandwidth value" as
        accepted by the BytesOption.

        Valid inputs: 100, 50%, 80.5%, 123M, 45.6k, 12.4G, 100K, 786.0, 0
        Invalid inputs: 100.1%, -4%, -500

        Return value will be a int if a bandwidth value was specified or a
        float if a percentage was given.

        ValueError will be raised if input couldn't be parsed.
        isno value specifiedit%scouldn't convert '%s' to numberiidspercentage is out of rangef100.0N(RHR)RRaRXR\RR(RR)Ra((RRNs

(R
RR(((RRfLst
BaseConfigcBs}tZdZdZdZedZdZeeZdZ	ee	Z	dZ
dZedZd	Z
RS(
sk
    Base class for storing configuration definitions. Subclass when creating
    your own definitons.
    cCsCd|_x3|iD]%}|i|}|i||qWdS(N(RRt_sectiontiterkeysRt	optionobjtoptionR$(RRlR((RR	rs
	
cCs[g}|id|ix1|iD]#\}}|id||fq'Wdi|S(Ns[%s]s%s: %rs
(RKRLRRit	iteritemsRRR4(RRRRK((Rt__str__ys
cCs||_||_x|iD]}|i|}d}y|i||}Wn=tt
fj
o+|o|iot||}qnX|i||||dj	ot|||qqWdS(s$Set option values from a INI file section.

        @param parser: ConfParser instance (or subclass)
        @param section: INI file section to read use.
        @param parent: Optional parent BaseConfig (or subclass) instance to use
            when doing option value inheritance.
        N(RRRiRtcfgRjRRkRlRRRdtNoSectionErrort
NoOptionErrortparentRRR%R#(RRRRrRlRR((Rtpopulates		

cCsqx?|f|iD]-}|ii|d}|dj	oPqqW|dj	ot|t	o|Snt
dS(s6Return the Option instance for the given name
        N(tclst	__bases__tklasst__dict__RdRRRRR
tKeyError(RtRRRv((RRks
	cCs3y|i|tSWntj
otSnXdS(sBReturn True if the given name refers to a defined option 
        N(RtRkRR,RxR(RtR((Rtisoptions
ccs%x|iD]\}}|Vq
WdS(s@Yield the names of all defined options in the instance.
        N(RRmRtitem(RRzR((RRjs
ccsBx;t|D]-}|i|o|t||fVq
q
WdS(sYield (name, value) pairs for every option in the instance.

        The value returned is the parsed, validated option value.
        N(tdirRRRyR(RR((RRms

cCs5tidtt||ot||Sn|S(NsxgetConfigOption() will go away in a future version of Yum.
Please access option values as attributes or using getattr().(twarningstwarntDeprecationWarningthasattrRRlRR(RRlR((RtgetConfigOptions
	cCsHtidtt||ot|||nti	d|dS(NsusetConfigOption() will go away in a future version of Yum.
Please set option values as attributes or using setattr().sNo such option %s(
R|R}R~RRRlR#RtErrorstConfigError(RRlR((RtsetConfigOptions
	(R
RRR	RnRRsRktclassmethodRyRjRmRR(((RRhls						
t	EarlyConfcBs&tZdZedZedZRS(s
    Configuration option definitions for yum.conf's [main] section that are
    required before the other [main] options can be parsed (mainly due to
    variable substitution).
    sfedora-releaset/(R
RRR
tdistroverpkgtinstallroot(((RRstYumConfc
Bs<tZdZedZedZedZedZedZ	e
eZedZ
eddgZeZedZeZeZed	Zed
Zedd#deZeZeZedgZedddddddddg	ZedddddgZedddddddgZeZe
eZ e
eZ!e
eZ"e
eZ#e
eZ$e
eZ%e
eZ&e
eZ'e
eZ(e
eZ)e
eZ*e
eZ+e
eZ,e
eZ-e.dZ/e0dZ1e2dZ3e4dd$Z5ed"Z6RS(%sy
    Configuration option definitions for yum.conf's [main] section.

    Note: inherits options from EarlyConf too.
    ii
is/var/cache/yums/var/log/yum.logs/etc/yum/repos.ds/etc/yum.repos.dt
LOG_DAEMONt
roundrobintunversionedR:R6R7R9R;s/usr/lib/yum-pluginstkernels
kernel-bigmemskernel-enterprises
kernel-smpskernel-modulesskernel-debugskernel-unsupporteds
kernel-sourceskernel-develskernel-BOOTtglibcskernel-hugememf30.0italltnonetpackagesi(shttpsftpshttps(RRsall(7R
RRRMt
debuglevelt
errorleveltretriestrecentR
tcachedirRPR,t	keepcachetlogfileR.treposdirtsyslog_identtsyslog_facilitytcommandstexcludetfailovermethodt
yumversionR5tproxytproxy_usernametproxy_passwordt
pluginpathtinstallonlypkgstkernelpkgnamest
exactarchlistttsflagsRt	assumeyestalwayspromptt	exactarchttoleranttdiskspacechecktoverwrite_groupst	keepalivetgpgcheckt	obsoletestshowdupesfromrepostenabledtpluginstenablegroupstenable_group_conditionalsRWttimeoutR\t	bandwidthRftthrottleRYthttp_cachingtmetadata_expire(((RRsT					'!	tRepoConfcBstZdZeZeeiZeZ	e
ZeZe
Ze
ZeeiZeeiZeeiZeeiZeeiZeeiZeeiZeeiZeeiZeeiZeeiZeeiZeeiZRS(s>
    Option definitions for repository INI file sections.
    (R
RRR
RR-RRRItbaseurlR5t
mirrorlisttgpgkeyR.RtincludepkgsRRRRRRRRRRRRR(((RRs*						cCsu|ti_t}t}tii	|ptid|n|i
||i|dt}tii|d<tii|d<t|i|i|d<t}td|}|i
||i|dx4d
D],}t||}t|||i|qWx4|iD])}|id	ptid
q q W||_d|_d|_ d|_"|S(sParse Yum's main configuration file

    @param configfile: Path to the configuration file to parse (typically
        '/etc/yum.conf').
    @param root: The base path to use for installation (typically '/')
    @return: Populated YumConf instance.
    sNo such config file %stmaintbasearchtarcht
releasevertvarsRRRs(All plugin search paths must be absoluteiN(scachedirslogfile(#trootRRRt	earlyconftIncludingConfigParsert
confparsertostpathtexistst
configfileRRtreadRst
_getEnvVarRtrpmUtilsRtgetBaseArchtgetCanonArcht
_getsysverRRtyumconfRlRR#Rt
startswithtyumvartuidtcacheRtprogess_obj(RRRRlRRRR((RtreadMainConfig5s:		
		

				cCst}|i||||ip||_tid|IJnt	|}xF|iD]8\}}|pt||o|i||q]q]W|i|_|ii|i||_|S(sParse an INI file section for a repository.

    @param parser: ConfParser or similar to read INI file values from.
    @param section: INI file section to read.
    @param mainconf: ConfParser or similar for yum.conf.
    @return: Repository instance.
    s8Repository %r is missing name in configuration, using idN(RtconfRsRRtmainconfRtsyststderrt
RepositorytthisrepoRmR]tvRR!RtbasecachedirRtupdateRo(RRRRRRR]((RtreadRepoConfiggs	
	
	cCsCy|i||}Wnttfj
o|SnX|i	|S(sConvenience function to retrieve a parsed and converted value from a
    ConfigParser.

    @param conf: ConfigParser instance or similar
    @param section: Section name
    @param name: Option name
    @param default: Value to use if option is missing
    @param option: Option instance to use for conversion.
    @return: The parsed value or default if value was not present.

    Will raise ValueError if the option could not be parsed.
    N(
RRdRRtvalRpRqRRlR(RRRRRlR((Rt	getOptions	cCs^h}xQtddD]@}d|}tii|d}|o|||i<qqW|S(sReturn variable replacements from the environment variables YUM0 to YUM9

    The result is intended to be used with parser.varReplace()
    ii
sYUM%dtN(	RtrangetnumtenvRtenvironRdRR?(RRRR((RRs
cCstiid|}|ititiB|i	d|}|idjo
d}n|i}|d}~~~|S(sCalculate the release version for the system.

    @param installroot: The value of the installroot option.
    @param distroverpkg: The value of the distroverpkg option.
    @return: The release version as a string (eg. '4' for FC4)
    RtprovidesitNulltversionN(RttransactiontinitReadOnlyTransactionRttstpushVSFlagstrpmt_RPMVSF_NOSIGNATURESt_RPMVSF_NODIGESTStdbMatchRtidxtcountRtnextthdr(RRRRRR((RRs

((RR|RR&R@RRRtIncludedDirConfigParsertConfigParserRpRqtrpmUtils.transactionRt
rpmUtils.archRtreposRtobjectRR
R-R.R5RIRMRPRWRYR\RfRhRRRRRRRR("RRRhRMRRRYR.R
RR5RRRRRR|R\R-RRRfRWRqRIR&RR@RRRPRpRR((Rt?s@									

o	
&0 h	<	2	!		

Anon7 - 2021