KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21573/root/usr/lib/python2.4/site-packages/iniparse/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21573/root/usr/lib/python2.4/site-packages/iniparse/compat.pyo
mò
½Pc@sÊdZdkZdklZlZlZlZlZlZl	Z	l
Z
dklZlZl
Z
lZdkZdefd„ƒYZdefd„ƒYZdefd	„ƒYZd
efd„ƒYZdS(s(Compatibility interfaces for ConfigParser

Interfaces of ConfigParser, RawConfigParser and SafeConfigParser
should be completely identical to the Python standard library
versions.  Tested with the unit tests included with Python-2.3.4

The underlying INIConfig object can be accessed as cfg.data
N(sDuplicateSectionErrorsNoSectionErrors
NoOptionErrorsInterpolationMissingOptionErrorsInterpolationDepthErrorsInterpolationSyntaxErrorsDEFAULTSECTsMAX_INTERPOLATION_DEPTH(sErrorsInterpolationErrorsMissingSectionHeaderErrorsParsingErrortRawConfigParsercBs
tZdd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
dd	„Zdd
„Zd„Z
d„Zd
„Zhde<de<de<de<de<de<de<de<Zd„Zd„Zd„Zd„Zd„Zd„ZRS(NcCstid|d|ƒ|_dS(Ntdefaultstoptionxformsource(tinit	INIConfigRtselftdata(RR((t3/usr/lib/python2.4/site-packages/iniparse/compat.pyt__init__scCs
|iƒS(N(t	optionstrtlower(RR	((Rtoptionxform!scCs=h}x0|iiiiƒD]\}}|i||<qW|S(N(	tdRRt	_defaultst_optionstitemstnametlineobjtvalue(RRRR((RR$s
cCs
t|iƒS(s3Return a list of section names, excluding [DEFAULT]N(tlistRR(R((Rtsections*scCs4|i|ƒot|ƒ‚n|ii|ƒdS(s“Create a new section in the configuration.

        Raise DuplicateSectionError if a section by the specified name
        already exists.
        N(Rthas_sectiontsectiontDuplicateSectionErrorRt
new_namespace(RR((Rtadd_section.scCs1y|i|tSWntj
otSnXdS(s~Indicate whether the named section is present in the configuration.

        The DEFAULT section is not acknowledged.
        N(RRRtTruetKeyErrortFalse(RR((RR9scCs;yt|i|ƒSWntj
ot|ƒ‚nXdS(s9Return a list of option names for the given section name.N(RRRRRtNoSectionError(RR((RtoptionsDs
cCsˆg}t|tƒo
|g}nx^|D]V}yt|ƒ}Wntj
o
q*nX|i|ƒ|i
i|ƒ|iƒq*W|S(s£Read and parse a filename or a list of filenames.

        Files that cannot be opened are silently ignored; this is
        designed so that you can specify a list of potential
        configuration file locations (e.g. current directory, user's
        home directory, systemwide directory), and all existing
        configuration files in the list will be read.  A single
        filename may also be given.
        N(
t
files_readt
isinstancet	filenamest
basestringtfilenametopentfptIOErrortappendRRtreadfptclose(RR!R%R#R((RtreadKs	

cCs|ii|ƒdS(sLike read() but the argument must be a file-like object.

        The `fp' argument must have a `readline' method.  Optional
        second argument is the `filename', which if not given, is
        taken from fp.name.  If fp has no `name' attribute, `<???>' is
        used.
        N(RRR(R%(RR%R#((RR(bscCs„|i|ƒpt|ƒ‚n|dj	o||jo||}ny|i||SWn"t	j
ot
||ƒ‚nXdS(N(RRRRtvarstNonetoptionRRRt
NoOptionError(RRR-R+R((RtgetlscCskyEg}x4|i|D]%}|i||i||ƒfƒqW|SWntj
ot|ƒ‚nXdS(N(	tansRRRtoptR'R/RR(RRR1R0((RRvs#cCst|i||ƒƒS(N(tintRR/RR-(RRR-((RtgetintscCst|i||ƒƒS(N(tfloatRR/RR-(RRR-((Rtgetfloat‚st1tyesttruetont0tnotfalsetoffcCsJ|i||ƒ}|iƒ|ijotd|‚n|i|iƒS(NsNot a boolean: %s(RR/RR-tvR
t_boolean_statest
ValueError(RRR-R>((Rt
getbooleanˆscCsay|i|}Wntj
ot|ƒ‚nXy||tSWntj
otSnXdS(s=Check for the existence of a given option in a given section.N(	RRRtsecRRR-RR(RRR-RB((Rt
has_optionŽscCs;y||i||<Wntj
ot|ƒ‚nXdS(sSet an option.N(RRRRR-RR(RRR-R((Rtsetšs
cCs|it|iƒƒdS(s?Write an .ini-format representation of the configuration state.N(R%twritetstrRR(RR%((RRE¡scCshy|i|}Wntj
ot|ƒ‚nXy||||=dSWntj
odSnXdS(sRemove an option.iiN(RRRRBRRR-(RRR-RB((Rt
remove_option¥scCs&|i|ƒptSn|i|=tS(sRemove a file section.N(RRRRRR(RR((Rtremove_section²s

(t__name__t
__module__R,RRRRRRRR*R(R/RR3R5RRR?RARCRDRERGRH(((RRs(							

				N					
t
ConfigDictcBs tZdZd„Zd„ZRS(s*Present a dict interface to a ini section.cCs||_||_||_dS(N(tcfgRRR+(RRLRR+((RR½s		cCsOy#ti|i|i||iƒSWn%ttfj
ot	|ƒ‚nXdS(N(
RR/RRLRtkeyR+R.RR(RRM((Rt__getitem__Âs#(RIRJt__doc__RRN(((RRKºs	tConfigParsercBs/tZedd„Zd„Zedd„ZRS(NcCs|tjo!|i|ƒot|ƒ‚n|i|ƒ}ti||||ƒ}|o|Sn)t|||ƒ}|i||||ƒSdS(s®Get an option value for a given section.

        All % interpolations are expanded in the return values, based on the
        defaults passed into the constructor, unless the optional argument
        `raw' is true.  Additional substitutions may be provided using the
        `vars' argument, which must be a dictionary whose contents overrides
        any pre-existing defaults.

        The section DEFAULT is special.
        N(RtDEFAULTSECTRRRRR-RR/R+RtrawRKRt_interpolate(RRR-RRR+RR((RR/Ës
cCs¦|}t}xg|o_|d8}d|joCy||}Wqqtj
o"}t||||dƒ‚qqXqPqW|i
dƒdjot|||ƒ‚n|S(Nis%(iiÿÿÿÿ(trawvalRtMAX_INTERPOLATION_DEPTHtdepthR+RtetInterpolationMissingOptionErrorR-RtfindtInterpolationDepthError(RRR-RTR+RWRRV((RRSâs

"c		CsD|tjo!|i|ƒot|ƒ‚n|djot|i|ƒ}nPg}x3|i|D]$}||jo|i|ƒqfqfW|i|i
ƒƒd|jo|idƒnt|||ƒ}|o-g}|D]}||||fqã~Sn<g}|D])}|||i|||||ƒfq~SdS(sØReturn a list of tuples with (name, value) for each option
        in the section.

        All % interpolations are expanded in the return values, based on the
        defaults passed into the constructor, unless the optional argument
        `raw' is true.  Additional substitutions may be provided using the
        `vars' argument, which must be a dictionary whose contents overrides
        any pre-existing defaults.

        The section DEFAULT is special.
        RIN(RRQRRRR+R,RRRtxR'textendtkeystremoveRKRRRt_[1]R-RS(	RRRRR+RR_R-R[R((RRôs"


-(RIRJRR,R/RSR(((RRPÉs	tSafeConfigParsercBs5tZd„Zd„ZeidƒiZd„ZRS(NcCs:t|tƒptdƒ‚nti||||ƒdS(Nsoption values must be strings(	R RR"t	TypeErrorRPRDRRR-(RRR-R((RRDscCs/g}|i|||||dƒdi|ƒS(Nit(tLRt_interpolate_someR-RTRR+tjoin(RRR-RTR+Rc((RRSss
%\(([^)]+)\)scCs¼|tjot|||ƒ‚nx’|oŠ|idƒ}
|
djo|i	|ƒdSn|
djo|i	||
 ƒ||
}n|dd!}	|	djo|i	dƒ|d}q&|	djoÐ|i|ƒ}|djot||d|ƒ‚n|idƒ}||iƒ}y||}Wn(tj
ot||||ƒ‚nXd|jo$|i||||||dƒq³|i	|ƒq&t||d|
ƒ‚q&WdS(Nt%iiit(s'bad interpolation variable reference %rs+'%' must be followed by '%' or '(', found: (RVRURZR-RtrestRYtptaccumR'tcRt_interpvar_matchtmR,tInterpolationSyntaxErrortgrouptvartendtmapR>RRXRd(RR-RjRhRRrRVRpRmRkRiR>((RRd%s@








	
	(	RIRJRDRStretcompiletmatchRlRd(((RR`s		(RORsRPRRR.RXRZRnRQRUtErrortInterpolationErrortMissingSectionHeaderErrortParsingErrorRtobjectRRKR`(R`RZRQRxRXRvRKRwRnRsRRURRyRR.RRP((Rt?s	7		N

Anon7 - 2021