ACC SHELL

Path : /usr/lib/python/
File Upload :
Current File : //usr/lib/python/ConfigParser.pyo

Ñò
nÄMc@sjdZddkZddddddd	d
ddd
ddg
ZdZdZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZ	defd„ƒYZ
de
fd„ƒYZde
fd„ƒYZde
fd„ƒYZ
d	efd„ƒYZd
efd„ƒYZd
fd„ƒYZdefd„ƒYZdefd „ƒYZdS(!sConfiguration file parser.

A setup file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.

The option values can contain format strings which refer to other values in
the same section, or values in a special [DEFAULT] section.

For example:

    something: %(dir)s/whatever

would resolve the "%(dir)s" to the value of dir.  All reference
expansions are done late, on demand.

Intrinsic defaults can be specified by passing them into the
ConfigParser constructor as a dictionary.

class:

ConfigParser -- responsible for parsing a list of
                configuration files, and managing the parsed database.

    methods:

    __init__(defaults=None)
        create the parser and specify a dictionary of intrinsic defaults.  The
        keys must be strings, the values must be appropriate for %()s string
        interpolation.  Note that `__name__' is always an intrinsic default;
        its value is the section's name.

    sections()
        return all the configuration section names, sans DEFAULT

    has_section(section)
        return whether the given section exists

    has_option(section, option)
        return whether the given option exists in the given section

    options(section)
        return list of configuration options for the named section

    read(filenames)
        read and parse the list of named configuration files, given by
        name.  A single filename is also allowed.  Non-existing files
        are ignored.  Return list of successfully read files.

    readfp(fp, filename=None)
        read and parse one configuration file, given as a file object.
        The filename defaults to fp.name; it is only used in error
        messages (if fp has no `name' attribute, the string `<???>' is used).

    get(section, option, raw=False, vars=None)
        return a string value for the named option.  All % interpolations are
        expanded in the return values, based on the defaults passed into the
        constructor and the DEFAULT section.  Additional substitutions may be
        provided using the `vars' argument, which must be a dictionary whose
        contents override any pre-existing defaults.

    getint(section, options)
        like get(), but convert value to an integer

    getfloat(section, options)
        like get(), but convert value to a float

    getboolean(section, options)
        like get(), but convert value to a boolean (currently case
        insensitively defined as 0, false, no, off for False, and 1, true,
        yes, on for True).  Returns False or True.

    items(section, raw=False, vars=None)
        return a list of tuples with (name, value) for each option
        in the section.

    remove_section(section)
        remove the given file section and all its options

    remove_option(section, option)
        remove the given option from the given section

    set(section, option, value)
        set the given option

    write(fp)
        write the configuration state in .ini format
iÿÿÿÿNtNoSectionErrortDuplicateSectionErrort
NoOptionErrortInterpolationErrortInterpolationDepthErrortInterpolationSyntaxErrortParsingErrortMissingSectionHeaderErrortConfigParsertSafeConfigParsertRawConfigParsertDEFAULTSECTtMAX_INTERPOLATION_DEPTHtDEFAULTi
tErrorcBsJeZdZd„Zd„ZeeeƒZdd„Zd„ZeZ	RS(s'Base class for ConfigParser exceptions.cCs|iS(sSGetter for 'message'; needed only to override deprecation in
        BaseException.(t_Error__message(tself((s"/usr/lib/python2.6/ConfigParser.pyt_get_messagemscCs
||_dS(sSSetter for 'message'; needed only to override deprecation in
        BaseException.N(R(Rtvalue((s"/usr/lib/python2.6/ConfigParser.pyt_set_messagerstcCs||_ti||ƒdS(N(tmessaget	Exceptiont__init__(Rtmsg((s"/usr/lib/python2.6/ConfigParser.pyR|s	cCs|iS(N(R(R((s"/usr/lib/python2.6/ConfigParser.pyt__repr__€s(
t__name__t
__module__t__doc__RRtpropertyRRRt__str__(((s"/usr/lib/python2.6/ConfigParser.pyRjs			cBseZdZd„ZRS(s2Raised when no section matches a requested option.cCs$ti|d|fƒ||_dS(NsNo section: %r(RRtsection(RR((s"/usr/lib/python2.6/ConfigParser.pyRˆs(RRRR(((s"/usr/lib/python2.6/ConfigParser.pyR…scBseZdZd„ZRS(s*Raised when a section is multiply-created.cCs!ti|d|ƒ||_dS(NsSection %r already exists(RRR(RR((s"/usr/lib/python2.6/ConfigParser.pyRs(RRRR(((s"/usr/lib/python2.6/ConfigParser.pyRŒscBseZdZd„ZRS(s!A requested option was not found.cCs0ti|d||fƒ||_||_dS(NsNo option %r in section: %r(RRtoptionR(RR R((s"/usr/lib/python2.6/ConfigParser.pyR–s	(RRRR(((s"/usr/lib/python2.6/ConfigParser.pyR“scBseZdZd„ZRS(s0Base class for interpolation-related exceptions.cCs&ti||ƒ||_||_dS(N(RRR R(RR RR((s"/usr/lib/python2.6/ConfigParser.pyRŸs	(RRRR(((s"/usr/lib/python2.6/ConfigParser.pyRœstInterpolationMissingOptionErrorcBseZdZd„ZRS(sAA string substitution required a setting which was not available.cCs9d||||f}ti||||ƒ||_dS(NsNBad value substitution:
	section: [%s]
	option : %s
	key    : %s
	rawval : %s
(RRt	reference(RR RtrawvalR"R((s"/usr/lib/python2.6/ConfigParser.pyR§s(RRRR(((s"/usr/lib/python2.6/ConfigParser.pyR!¤scBseZdZRS(sjRaised when the source text into which substitutions are made
    does not conform to the required syntax.(RRR(((s"/usr/lib/python2.6/ConfigParser.pyR±scBseZdZd„ZRS(s0Raised when substitutions are nested too deeply.cCs-d|||f}ti||||ƒdS(NsSValue interpolation too deeply recursive:
	section: [%s]
	option : %s
	rawval : %s
(RR(RR RR#R((s"/usr/lib/python2.6/ConfigParser.pyR¸s(RRRR(((s"/usr/lib/python2.6/ConfigParser.pyRµscBs eZdZd„Zd„ZRS(s>Raised when a configuration file does not follow legal syntax.cCs*ti|d|ƒ||_g|_dS(Ns File contains parsing errors: %s(RRtfilenameterrors(RR$((s"/usr/lib/python2.6/ConfigParser.pyRÃs	cCs3|ii||fƒ|id||f7_dS(Ns
	[line %2d]: %s(R%tappendR(Rtlinenotline((s"/usr/lib/python2.6/ConfigParser.pyR&Ès(RRRRR&(((s"/usr/lib/python2.6/ConfigParser.pyRÀs	cBseZdZd„ZRS(s@Raised when a key-value pair is found before any section header.cCs<ti|d|||fƒ||_||_||_dS(Ns7File contains no section headers.
file: %s, line: %d
%r(RRR$R'R((RR$R'R(((s"/usr/lib/python2.6/ConfigParser.pyRÏs		(RRRR(((s"/usr/lib/python2.6/ConfigParser.pyRÌscBs*eZded„Zd„Zd„Zd„Zd„Zd„Z	d„Z
dd„Zd„Zd	„Z
d
„Zd„Zd„Zhed
6ed6ed6ed6ed6ed6ed6ed6Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZeidƒZeidƒZd„ZRS( cCsi||_|iƒ|_|iƒ|_|o7x4|iƒD]"\}}||i|i|ƒ<q;WndS(N(t_dictt	_sectionst	_defaultstitemstoptionxform(Rtdefaultst	dict_typetkeyR((s"/usr/lib/python2.6/ConfigParser.pyRÚs	
cCs|iS(N(R+(R((s"/usr/lib/python2.6/ConfigParser.pyR.âscCs
|iiƒS(s3Return a list of section names, excluding [DEFAULT](R*tkeys(R((s"/usr/lib/python2.6/ConfigParser.pytsectionsåscCs[|iƒdjotd|‚n||ijot|ƒ‚n|iƒ|i|<dS(séCreate a new section in the configuration.

        Raise DuplicateSectionError if a section by the specified name
        already exists. Raise ValueError if name is DEFAULT or any of it's
        case-insensitive variants.
        tdefaultsInvalid section name: %sN(tlowert
ValueErrorR*RR)(RR((s"/usr/lib/python2.6/ConfigParser.pytadd_sectionês
cCs
||ijS(s~Indicate whether the named section is present in the configuration.

        The DEFAULT section is not acknowledged.
        (R*(RR((s"/usr/lib/python2.6/ConfigParser.pythas_sectionøscCsky|i|iƒ}Wntj
ot|ƒ‚nX|i|iƒd|jo|d=n|iƒS(s9Return a list of option names for the given section name.R(R*tcopytKeyErrorRtupdateR+R1(RRtopts((s"/usr/lib/python2.6/ConfigParser.pytoptionsÿs
cCsˆt|tƒo
|g}ng}x^|D]V}yt|ƒ}Wntj
o
q*nX|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.

        Return list of successfully read files.
        (t
isinstancet
basestringtopentIOErrort_readtcloseR&(Rt	filenamestread_okR$tfp((s"/usr/lib/python2.6/ConfigParser.pytread
s

cCsN|djo-y
|i}Wq:tj
o
d}q:Xn|i||ƒ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.

        s<???>N(tNonetnametAttributeErrorRA(RRER$((s"/usr/lib/python2.6/ConfigParser.pytreadfp#s	

cCs¾|i|ƒ}||ijoL|tjot|ƒ‚n||ijo|i|St||ƒ‚nP||i|jo|i||S||ijo|i|St||ƒ‚dS(N(R-R*RRR+R(RRR topt((s"/usr/lib/python2.6/ConfigParser.pytget3s
cCsŽy|i|}Wn<tj
o0|tjot|ƒ‚n|iƒ}nX|iiƒ}|i|ƒd|jo|d=n|iƒS(NR(	R*R9RRR)R+R8R:R,(RRtd2td((s"/usr/lib/python2.6/ConfigParser.pyR,Cs


cCs||i||ƒƒS(N(RL(RRtconvR ((s"/usr/lib/python2.6/ConfigParser.pyt_getPscCs|i|t|ƒS(N(RPtint(RRR ((s"/usr/lib/python2.6/ConfigParser.pytgetintSscCs|i|t|ƒS(N(RPtfloat(RRR ((s"/usr/lib/python2.6/ConfigParser.pytgetfloatVst1tyesttruetont0tnotfalsetoffcCsJ|i||ƒ}|iƒ|ijotd|‚n|i|iƒS(NsNot a boolean: %s(RLR4t_boolean_statesR5(RRR tv((s"/usr/lib/python2.6/ConfigParser.pyt
getboolean\scCs
|iƒS(N(R4(Rt	optionstr((s"/usr/lib/python2.6/ConfigParser.pyR-bscCs{|p
|tjo|i|ƒ}||ijS||ijotS|i|ƒ}||i|jp
||ijSdS(s=Check for the existence of a given option in a given section.N(RR-R+R*tFalse(RRR ((s"/usr/lib/python2.6/ConfigParser.pyt
has_optionescCsl|p
|tjo
|i}n4y|i|}Wntj
ot|ƒ‚nX|||i|ƒ<dS(sSet an option.N(RR+R*R9RR-(RRR Rtsectdict((s"/usr/lib/python2.6/ConfigParser.pytsetqs
c
Cs	|iok|idtƒxF|iiƒD]5\}}|id|t|ƒiddƒfƒq+W|idƒnx|iD]‚}|id|ƒx[|i|iƒD]F\}}|djo-|id|t|ƒiddƒfƒqªqªW|idƒqWdS(s?Write an .ini-format representation of the configuration state.s[%s]
s%s = %s
s
s
	RN(R+twriteRR,tstrtreplaceR*(RRER0RR((s"/usr/lib/python2.6/ConfigParser.pyRe|s
-

	(cCs†|p
|tjo
|i}n4y|i|}Wntj
ot|ƒ‚nX|i|ƒ}||j}|o||=n|S(sRemove an option.(RR+R*R9RR-(RRR Rctexisted((s"/usr/lib/python2.6/ConfigParser.pyt
remove_option‹s
cCs(||ij}|o|i|=n|S(sRemove a file section.(R*(RRRh((s"/usr/lib/python2.6/ConfigParser.pytremove_sectionšss\[(?P<header>[^]]+)\]s9(?P<option>[^:=\s][^:=]*)\s*(?P<vi>[:=])\s*(?P<value>.*)$cCsÖd}d}d}d}x¦tož|iƒ}|pPn|d}|iƒdjp|ddjoqn|iddƒdiƒdjo|ddjoqn|diƒoG|dj	o:|o3|iƒ}|od|||f||<q¼q|ii|ƒ}	|	ow|	i	dƒ}
|
|i
jo|i
|
}n>|
tjo
|i}n$|i
ƒ}|
|d	<||i
|
<d}q|djot|||ƒ‚q|ii|ƒ}	|	oÁ|	i	d
ddƒ\}}}|djoPd|joC|idƒ}
|
djo#||
diƒo||
 }qIn|iƒ}|djo
d}n|i|iƒƒ}|||<q|pt|ƒ}n|i|t|ƒƒqW|o
|‚ndS(s®Parse a sectioned setup file.

        The sections in setup file contains a title line at the top,
        indicated by a name in square brackets (`[]'), plus key/value
        options lines, indicated by `name: value' format lines.
        Continuations are represented by an embedded newline then
        leading whitespace.  Blank lines, lines beginning with a '#',
        and just about everything else are ignored.
        iiRs#;tremtrRs%s
%stheaderRR tviRt=t:t;iÿÿÿÿs""N(RoRp(RGtTruetreadlinetstriptsplitR4tisspacetSECTCREtmatchtgroupR*RR+R)RtOPTCREtfindR-trstripRR&trepr(RREtfpnametcursecttoptnameR'teR(RtmotsectnameRntoptvaltpos((s"/usr/lib/python2.6/ConfigParser.pyRA²s`

$4% 





"

N( RRRGtdictRR.R2R6R7R<RFRJRLR,RPRRRTRrRaR]R_R-RbRdReRiRjtretcompileRwRzRA(((s"/usr/lib/python2.6/ConfigParser.pyR
Ùs6								
										
		cBsGeZedd„Zedd„Zd„ZeidƒZ	d„Z
RS(c
Csý|iiƒ}y|i|i|ƒWn0tj
o$|tjot|ƒ‚qZnX|o4x1|iƒD]\}}|||i|ƒ<qnWn|i|ƒ}y||}Wn"tj
ot	||ƒ‚nX|o|S|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(R+R8R:R*R9RRR,R-Rt_interpolate(RRR trawtvarsRNR0R((s"/usr/lib/python2.6/ConfigParser.pyRLs$

cCs/|iiƒ}y|i|i|ƒWn0tj
o$|tjot|ƒ‚qZnX|o4x1|iƒD]\}}|||i|ƒ<qnWn|i	ƒ}d|jo|i
dƒn|o*g}|D]}	||	||	fqÑ~Sg}
|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.
        RN(R+R8R:R*R9RRR,R-R1tremoveR‰(RRRŠR‹RNR0RR<t_[1]R t_[2]((s"/usr/lib/python2.6/ConfigParser.pyR,#s$


#cCs¸|}t}x‚|oz|d8}d|jo^|ii|i|ƒ}y||}WqŒtj
o%}t||||idƒ‚qŒXqPqWd|jot|||ƒ‚n|S(Nis%(i(Rt_KEYCREtsubt_interpolation_replaceR9R!targsR(RRR R#R‹RtdepthR((s"/usr/lib/python2.6/ConfigParser.pyR‰Cs 

"
s%\(([^)]*)\)s|.cCs<|idƒ}|djo|iƒSd|i|ƒSdS(Nis%%(%s)s(RyRGR-(RRxts((s"/usr/lib/python2.6/ConfigParser.pyR‘Xs
N(RRRaRGRLR,R‰R‡RˆRR‘(((s"/usr/lib/python2.6/ConfigParser.pyRs
  	cBs2eZd„ZeidƒZd„Zd„ZRS(cCs/g}|i|||||dƒdi|ƒS(NiR(t_interpolate_sometjoin(RRR R#R‹tL((s"/usr/lib/python2.6/ConfigParser.pyR‰bss
%\(([^)]+)\)scCsÇ|tjot|||ƒ‚nx|o•|idƒ}|djo|i|ƒdS|djo|i|| ƒ||}n|dd!}|djo|idƒ|d}q&|djoÜ|ii|ƒ}	|	djot||d|ƒ‚n|i|	i	dƒƒ}
||	i
ƒ}y||
}Wn(tj
ot||||
ƒ‚nXd|jo$|i
||||||dƒq¾|i|ƒq&t||d|fƒ‚q&WdS(Nt%iiit(s'bad interpolation variable reference %rs/'%%' must be followed by '%%' or '(', found: %r(RRR{R&t
_interpvar_reRxRGRR-RytendR9R!R•(RR taccumtrestRtmapR“tptctmtvarR^((s"/usr/lib/python2.6/ConfigParser.pyR•jsD








	
cCs—t|tƒptdƒ‚n|iddƒ}|iid|ƒ}|idƒ}|djotd||fƒ‚nti	||||ƒdS(sASet an option.  Extend ConfigParser.set: check for string values.soption values must be stringss%%RR˜iÿÿÿÿs1invalid interpolation syntax in %r at position %dN(
R=R>t	TypeErrorRgRšRR{R5RRd(RRR Rt	tmp_valuet
percent_index((s"/usr/lib/python2.6/ConfigParser.pyRds
(RRR‰R‡RˆRšR•Rd(((s"/usr/lib/python2.6/ConfigParser.pyR	`s		&(RR‡t__all__RRRRRRRRR!RRRRR
RR	(((s"/usr/lib/python2.6/ConfigParser.pyt<module>Xs.			

ÿ)_

ACC SHELL 2018