-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/configobj.pyc


 \Sc@sddlZddlZddlZddlmZmZmZmZddlZddl	m
Z
eaidefe6ddfe6ddfe6ddfe6Z
idd6dd6dd	6dd
6dd6dd6dd6dd6dd
6dd6dd6dd6dd6dd6dd6Zied6ed6ed6ed6ee6ZdZdZdZdZdZdZdZeZddddddd d!d"d#d$d%d&d'd(d)d*d+fZd,Zd-Zd.Zied/6ed06ed16ed26ed36ed46ed56ed66ed76ed86ed96ed:6Zd;Z d)e!fd<YZ"d=efd>YZ#e#Z$d?Z%de&fd@YZ'de'fdAYZ(de'fdBYZ)d'e*fdCYZ+de'fdDYZ,d e'fdEYZ-d#e'fdFYZ.d$e.fdGYZ/d&e'fdHYZ0d%e.fdIYZ1d(e'fdJYZ2dKefdLYZ3dMe3fdNYZ4dOe3fdPYZ5ie4d,6e5dQ6Z6dRZ7dSe8fdTYZ9d!e9fdUYZ:d"efdVYZ;eedWZ<fdXZ=dS(YiN(tBOM_UTF8t	BOM_UTF16tBOM_UTF16_BEtBOM_UTF16_LE(t__version__tutf_8tutf16_betutf_16tutf16_letu16tutf16sutf-16t	utf_16_besutf-16bet	utf_16_lesutf-16letu8tutftutf8sutf-8cCstj|jdkS(NR(tBOM_LISTtgettlower(tencoding((s-/usr/lib/python2.7/dist-packages/configobj.pyt
match_utf8Dss'%s's"%s"s%ss 
	'"s"""%s"""s'''%s'''tDEFAULT_INDENT_TYPEtDEFAULT_INTERPOLATIONtConfigObjErrortNestingErrort
ParseErrortDuplicateErrortConfigspecErrort	ConfigObjt	SimpleValtInterpolationErrortInterpolationLoopErrortMissingInterpolationOptiontRepeatSectionErrortReloadErrortUnreprErrortUnknownTypetflatten_errorstget_extra_valuestconfigparsers    i
t
interpolationtraise_errorstlist_valuestcreate_emptyt
file_errort
configspect	stringifytindent_typeRtdefault_encodingtunreprtwrite_empty_valuescCsVtdkrddland|}tj|}|jdjdjdS(Nisa=ii(tcompilertNonetparsetgetChildren(tstp((s-/usr/lib/python2.7/dist-packages/configobj.pytgetObjs

cBseZRS((t__name__t
__module__(((s-/usr/lib/python2.7/dist-packages/configobj.pyR$stBuildercBsbeZdZdZdZdZdZdZdZdZ	dZ
d	ZRS(
cCs+tdkr!t|jjnt|S(N(tmR4R$t	__class__R:(tselfto((s-/usr/lib/python2.7/dist-packages/configobj.pytbuildscCstt|j|jS(N(tlisttmapRAR6(R?R@((s-/usr/lib/python2.7/dist-packages/configobj.pyt
build_ListscCs|jS(N(tvalue(R?R@((s-/usr/lib/python2.7/dist-packages/configobj.pytbuild_ConstscCsIi}tt|j|j}x|D]}t|||<q+W|S(N(titerRCRAR6tnext(R?R@tdtitel((s-/usr/lib/python2.7/dist-packages/configobj.pyt
build_Dicts

cCst|j|S(N(ttupleRD(R?R@((s-/usr/lib/python2.7/dist-packages/configobj.pytbuild_TuplescCsI|jdkrdS|jdkr&tS|jdkr9tStddS(NR4tTruetFalsesUndefined Name(tnameR4RORPR$(R?R@((s-/usr/lib/python2.7/dist-packages/configobj.pyt
build_NamescCstt|j|j\}}yt|}Wntk
rStdnXt|tss|j	dkrtdn||S(NtAddg(
RBRCRFR6tfloatt	TypeErrorR$t
isinstancetcomplextreal(R?R@RXtimag((s-/usr/lib/python2.7/dist-packages/configobj.pyt	build_Adds$
cCs"|j|j}t||jS(N(RAtexprtgetattrtattrname(R?R@tparent((s-/usr/lib/python2.7/dist-packages/configobj.pyt
build_GetattrscCs|j|jdS(Ni(RFR6(R?R@((s-/usr/lib/python2.7/dist-packages/configobj.pytbuild_UnarySubscCs|j|jdS(Ni(RFR6(R?R@((s-/usr/lib/python2.7/dist-packages/configobj.pytbuild_UnaryAdds(R:R;RARDRFRLRNRRRZR_R`Ra(((s-/usr/lib/python2.7/dist-packages/configobj.pyR<s							
		cCs#|s
|Sddl}|j|S(Ni(tasttliteral_eval(R7Rb((s-/usr/lib/python2.7/dist-packages/configobj.pyR1scBs eZdZddddZRS(sk
    This is the base class for all errors that ConfigObj raises.
    It is a subclass of SyntaxError.
    tcCs&||_||_tj||dS(N(tlinetline_numbertSyntaxErrort__init__(R?tmessageRfRe((s-/usr/lib/python2.7/dist-packages/configobj.pyRhs		N(R:R;t__doc__R4Rh(((s-/usr/lib/python2.7/dist-packages/configobj.pyRscBseZdZRS(sE
    This error indicates a level of nesting that doesn't match.
    (R:R;Rj(((s-/usr/lib/python2.7/dist-packages/configobj.pyRscBseZdZRS(s
    This error indicates that a line is badly written.
    It is neither a valid ``key = value`` line,
    nor a valid section marker line.
    (R:R;Rj(((s-/usr/lib/python2.7/dist-packages/configobj.pyRscBseZdZdZRS(sW
    A 'reload' operation failed.
    This exception is a subclass of ``IOError``.
    cCstj|ddS(Ns#reload failed, filename is not set.(tIOErrorRh(R?((s-/usr/lib/python2.7/dist-packages/configobj.pyRhs(R:R;RjRh(((s-/usr/lib/python2.7/dist-packages/configobj.pyR"scBseZdZRS(s:
    The keyword or section specified already exists.
    (R:R;Rj(((s-/usr/lib/python2.7/dist-packages/configobj.pyRscBseZdZRS(s7
    An error occured whilst parsing a configspec.
    (R:R;Rj(((s-/usr/lib/python2.7/dist-packages/configobj.pyRscBseZdZRS(s,Base class for the two interpolation errors.(R:R;Rj(((s-/usr/lib/python2.7/dist-packages/configobj.pyRscBseZdZdZRS(s=Maximum interpolation depth exceeded in string interpolation.cCstj|d|dS(Ns*interpolation loop detected in value "%s".(RRh(R?toption((s-/usr/lib/python2.7/dist-packages/configobj.pyRhs(R:R;RjRh(((s-/usr/lib/python2.7/dist-packages/configobj.pyRscBseZdZRS(sk
    This error indicates additional sections in a section with a
    ``__many__`` (repeated) section.
    (R:R;Rj(((s-/usr/lib/python2.7/dist-packages/configobj.pyR!scBseZdZdZRS(s0A value specified for interpolation was missing.cCsd|}tj||dS(Ns%missing option "%s" in interpolation.(RRh(R?Rltmsg((s-/usr/lib/python2.7/dist-packages/configobj.pyRhs
(R:R;RjRh(((s-/usr/lib/python2.7/dist-packages/configobj.pyR scBseZdZRS(s An error parsing in unrepr mode.(R:R;Rj(((s-/usr/lib/python2.7/dist-packages/configobj.pyR#stInterpolationEnginecBsGeZdZejdZdZdZdZdZ	dZ
RS(s
    A helper class to help perform string interpolation.

    This class is an abstract base class; its descendants perform
    the actual work.
    s
%\(([^)]*)\)st%cCs
||_dS(N(tsection(R?Rp((s-/usr/lib/python2.7/dist-packages/configobj.pyRh*scsAj|kr|Sfd||ji}|S(Ncs||jf|kr$t|nd|||jf<jj|}x|rj|\}}}|dkr|}n||||}|j\}	}
dj||	 |||
f}|	t|}jj||}qLW|||jf=|S(sxThe function that does the actual work.

            ``value``: the string we're trying to interpolate.
            ``section``: the section in which that string was found
            ``backtrail``: a dict to keep track of where we've been,
            to detect and prevent infinite recursion loops

            This is similar to a depth-first-search algorithm.
            iRdN(	RQRt_KEYCREtsearcht_parse_matchR4tspantjointlen(tkeyRERpt	backtrailtmatchtktvR7treplacementtstarttendtnew_search_start(trecursive_interpolateR?(s-/usr/lib/python2.7/dist-packages/configobj.pyR4s		 (t_cookieRp(R?RwRE((RR?s-/usr/lib/python2.7/dist-packages/configobj.pytinterpolate/s
,cCs|jjj}t|jj_|j}xtr|j|}|dk	r_t|tr_Pn|jdij|}|dk	rt|trPn|j	|krPn|j	}q*W||jj_|dkrt
|n||fS(sHelper function to fetch values from owning section.

        Returns a 2-tuple: the value, and the section where it was found.
        tDEFAULTN(RptmainR(RPRORR4RVtSectionR^R (R?Rwtsave_interptcurrent_sectiontval((s-/usr/lib/python2.7/dist-packages/configobj.pyt_fetchds"		
cCs
tdS(sImplementation-dependent helper function.

        Will be passed a match object corresponding to the interpolation
        key we just found (e.g., "%(foo)s" or "$foo"). Should look up that
        key in the appropriate config file section (using the ``_fetch()``
        helper function) and return a 3-tuple: (key, value, section)

        ``key`` is the name of the key we're looking for
        ``value`` is the value found for that key
        ``section`` is a reference to the section where it was found

        ``key`` and ``section`` should be None if no further
        interpolation should be performed on the resulting value
        (e.g., if we interpolated "$$" and returned "$").
        N(tNotImplementedError(R?Ry((s-/usr/lib/python2.7/dist-packages/configobj.pyRss(R:R;RjtretcompileRqRRhRRRs(((s-/usr/lib/python2.7/dist-packages/configobj.pyRns		5	"tConfigParserInterpolationcBs,eZdZdZejdZdZRS(sBehaves like ConfigParser.Ros
%\(([^)]*)\)scCs1|jd}|j|\}}|||fS(Ni(tgroupR(R?RyRwRERp((s-/usr/lib/python2.7/dist-packages/configobj.pyRss(R:R;RjRRRRqRs(((s-/usr/lib/python2.7/dist-packages/configobj.pyRstTemplateInterpolationcBs?eZdZdZdZejdejejBZ	dZ
RS(sBehaves like string.Template.t$s
        \$(?:
          (?P<escaped>\$)              |   # Two $ signs
          (?P<named>[_a-z][_a-z0-9]*)  |   # $name format
          {(?P<braced>[^}]*)}              # ${name} format
        )
        cCs|jdp|jd}|dk	rL|j|\}}|||fS|jddk	rqd|jdfSd|jdfS(Ntnamedtbracedtescaped(RR4Rt
_delimiter(R?RyRwRERp((s-/usr/lib/python2.7/dist-packages/configobj.pyRss
(R:R;RjRRRRt
IGNORECASEtVERBOSERqRs(((s-/usr/lib/python2.7/dist-packages/configobj.pyRsttemplatecGs|j||S(N(t__new__(tclstargs((s-/usr/lib/python2.7/dist-packages/configobj.pyt
__newobj__sRcBsReZdZdZdZd!d!dZdZdZdZ	e
dZdZd!d	Z
d
ZedZdZd
Zd!dZdZdZdZdZdZeZdZdZeZde_dZdZdZe e
dZ!dZ"dZ#dZ$dZ%dZ&d Z'RS("s
    A dictionary-like object that represents a section in a config file.
    
    It does string interpolation if the 'interpolation' attribute
    of the 'main' object is set to True.
    
    Interpolation is tried first from this object, then from the 'DEFAULT'
    section of this object, next from the parent and its 'DEFAULT' section,
    and so on until the main object is reached.
    
    A Section will behave like an ordered dictionary - following the
    order of the ``scalars`` and ``sections`` attributes.
    You can use this to change the order of members.
    
    Iteration follows the order: scalars, then sections.
    cCs,tj||d|jj|ddS(Nii(tdicttupdatet__dict__(R?tstate((s-/usr/lib/python2.7/dist-packages/configobj.pyt__setstate__scCs(t||jf}t|jf|fS(N(RRRR>(R?R((s-/usr/lib/python2.7/dist-packages/configobj.pyt
__reduce__scCs{|dkri}ntj|||_||_||_||_|jx$|jD]\}}|||<q]WdS(s
        * parent is the section above
        * depth is the depth level of this section
        * main is the main ConfigObj
        * indict is a dictionary to initialise the section with
        N(	R4RRhR^RtdepthRQt_initialisetitems(R?R^RRtindictRQtentryRE((s-/usr/lib/python2.7/dist-packages/configobj.pyRhs	
				
cCsUg|_g|_i|_i|_d|_g|_i|_g|_t	|_
dS(N(tscalarstsectionstcommentstinline_commentsR4R-tdefaultstdefault_valuestextra_valuesRPt_created(R?((s-/usr/lib/python2.7/dist-packages/configobj.pyRs								cCsy
|j}Wntk
r|jj}|tkr>t}n|j}tj|d}|dkrxt
|j_|S||}|_nX|j||S(N(t_interpolation_enginetAttributeErrorRR(RORRtinterpolation_enginesRR4RPR(R?RwREtengineRQtclass_((s-/usr/lib/python2.7/dist-packages/configobj.pyt_interpolates

	cstj}jjrt|tjr@j|St|trfd}g|D]}||^qh}||kr|Sqn|S(s+Fetch the item and do string interpolation.cs&t|tjr"j|S|S(N(RVtsixtstring_typesR(R(RwR?(s-/usr/lib/python2.7/dist-packages/configobj.pyt_check/s(	Rt__getitem__RR(RVRRRRB(R?RwRRRtnew((RwR?s-/usr/lib/python2.7/dist-packages/configobj.pyR(s
cCst|tjs%td|n||jkrQg|j|<d|j|<n||jkrs|jj|nt|tr||kr|j	j
|ntj|||n't|tr*|r*||kr|j	j
|n|j
d}tj||t|||jd|d|n||krI|jj
|n|jjst|tjrjqt|ttfrxF|D]+}t|tjstd|qqWqtd|ntj|||dS(s
        Correctly set a value.
        
        Making dictionary values Section instances.
        (We have to special case 'Section' instances - which are also dicts)
        
        Keys must be strings.
        Values need only be strings (or lists of strings) if
        ``main.stringify`` is set.
        
        ``unrepr`` must be set when setting a value to a dictionary, without
        creating a new sub-section.
        sThe key "%s" is not a string.RdiRRQsValue is not a string "%s".N(RVRRt
ValueErrorRRRtremoveRRtappendRt__setitem__RRRR.RBRMRU(R?RwRER1t	new_depthR((s-/usr/lib/python2.7/dist-packages/configobj.pyR9sF

	

cCsZtj||||jkr2|jj|n|jj||j|=|j|=dS(s-Remove items from the sequence when deleting.N(Rt__delitem__RRRRR(R?Rw((s-/usr/lib/python2.7/dist-packages/configobj.pyRts
cCs%y||SWntk
r |SXdS(s>A version of ``get`` that doesn't bypass string interpolation.N(tKeyError(R?Rwtdefault((s-/usr/lib/python2.7/dist-packages/configobj.pyRs
cCs#x|D]}||||<qWdS(sD
        A version of update that uses our ``__setitem__``.
        N((R?RR((s-/usr/lib/python2.7/dist-packages/configobj.pyRs
cCsEy||}Wn)tk
r9|tkr0n|}nX||=|S(s
        'D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
        If key is not found, d is returned if given, otherwise KeyError is raised'
        (RtMISSING(R?RwRR((s-/usr/lib/python2.7/dist-packages/configobj.pytpops

cCsJ|j|j}|s%tdn|d}||}||=||fS(sPops the first (key,val)s": 'popitem(): dictionary is empty'i(RRR(R?tsequenceRwR((s-/usr/lib/python2.7/dist-packages/configobj.pytpopitems

cCsPtj|g|_g|_i|_i|_d|_g|_g|_	dS(s
        A version of clear that also affects scalars/sections
        Also clears comments and configspec.
        
        Leaves other attributes alone :
            depth/main/parent are not affected
        N(
RtclearRRRRR4R-RR(R?((s-/usr/lib/python2.7/dist-packages/configobj.pyRs
						cCs3y||SWn tk
r.|||<||SXdS(s:A version of setdefault that sets sequence if appropriate.N(R(R?RwR((s-/usr/lib/python2.7/dist-packages/configobj.pyt
setdefaults


cCs)tt|j|jt|jS(s8D.items() -> list of D's (key, value) pairs, as 2-tuples(RBtzipRRtvalues(R?((s-/usr/lib/python2.7/dist-packages/configobj.pyRscCs|j|jS(sD.keys() -> list of D's keys(RR(R?((s-/usr/lib/python2.7/dist-packages/configobj.pytkeysscCs%g|j|jD]}||^qS(s D.values() -> list of D's values(RR(R?Rw((s-/usr/lib/python2.7/dist-packages/configobj.pyRscCstt|jS(s=D.iteritems() -> an iterator over the (key, value) items of D(RGRBR(R?((s-/usr/lib/python2.7/dist-packages/configobj.pyt	iteritemsscCst|j|jS(s.D.iterkeys() -> an iterator over the keys of D(RGRR(R?((s-/usr/lib/python2.7/dist-packages/configobj.pytiterkeysscCstt|jS(s2D.itervalues() -> an iterator over the values of D(RGRBR(R?((s-/usr/lib/python2.7/dist-packages/configobj.pyt
itervaluessc	sYfd}ddjgjjD](}dt|t||f^q)S(sx.__repr__() <==> repr(x)cs1y|SWntk
r,tj|SXdS(N(R RR(Rw(R?(s-/usr/lib/python2.7/dist-packages/configobj.pyt_getvals
s{%s}s, s%s: %s(RuRRtrepr(R?RRw((R?s-/usr/lib/python2.7/dist-packages/configobj.pyt__repr__ssx.__str__() <==> str(x)cCsi}x||D]t}||}t|tr;|j}n<t|trYt|}nt|trwt|}n|||<q
W|S(s0
        Return a deepcopy of self as a dictionary.
        
        All members that are ``Section`` instances are recursively turned to
        ordinary dictionaries - by calling their ``dict`` method.
        
        >>> n = a.dict()
        >>> n == a
        1
        >>> n is a
        0
        (RVRRRBRM(R?tnewdictRt
this_entry((s-/usr/lib/python2.7/dist-packages/configobj.pyRs


cCssxlt|jD]X\}}||krat||trat|tra||j|q|||<qWdS(sQ
        A recursive update - useful for merging config files.
        
        >>> a = '''[section1]
        ...     option1 = True
        ...     [[subsection]]
        ...     more_options = False
        ...     # end of file'''.splitlines()
        >>> b = '''# File is user.ini
        ...     [section1]
        ...     option1 = False
        ...     # end of file'''.splitlines()
        >>> c1 = ConfigObj(b)
        >>> c2 = ConfigObj(a)
        >>> c2.merge(c1)
        >>> c2
        ConfigObj({'section1': {'option1': 'False', 'subsection': {'more_options': 'False'}}})
        N(RBRRVRtmerge(R?RRwR((s-/usr/lib/python2.7/dist-packages/configobj.pyRs
cCs||jkr|j}n+||jkr6|j}ntd||j|}||}tj||tj||||j||j|||j	|}|j
|}|j	|=|j
|=||j	|<||j
|<dS(s
        Change a keyname to another, without changing position in sequence.
        
        Implemented so that transformations can be made on keys,
        as well as on values. (used by encode and decode)
        
        Also renames comments.
        sKey "%s" not found.N(RRRtindexRRRRtinsertRR(R?toldkeytnewkeytthe_listtposRtcommtinline_comment((s-/usr/lib/python2.7/dist-packages/configobj.pytrename,s"	






c	KsOi}xtt|jD]w}|j|}y-||||}|j|}|||<Wqtk
r|rxq|j|}t||<qXqWxtt|jD]}|j|}|r!y||||Wn4tk
r|rq|j|}t||<nX|j|}n||j|d|d||||<qW|S(s
        Walk every member and call a function on the keyword and value.
        
        Return a dictionary of the return values
        
        If the function raises an exception, raise the errror
        unless ``raise_errors=False``, in which case set the return value to
        ``False``.
        
        Any unrecognised keyword arguments you pass to walk, will be pased on
        to the function you pass in.
        
        Note: if ``call_on_sections`` is ``True`` then - on encountering a
        subsection, *first* the function is called for the *whole* subsection,
        and then recurses into it's members. This means your function must be
        able to handle strings, dictionaries and lists. This allows you
        to change the key of subsections as well as for ordinary members. The
        return value when called on the whole subsection has to be discarded.
        
        See  the encode and decode methods for examples, including functions.
        
        .. admonition:: caution
        
            You can use ``walk`` to transform the names of members of a section
            but you mustn't add or delete members.
        
        >>> config = '''[XXXXsection]
        ... XXXXkey = XXXXvalue'''.splitlines()
        >>> cfg = ConfigObj(config)
        >>> cfg
        ConfigObj({'XXXXsection': {'XXXXkey': 'XXXXvalue'}})
        >>> def transform(section, key):
        ...     val = section[key]
        ...     newkey = key.replace('XXXX', 'CLIENT1')
        ...     section.rename(key, newkey)
        ...     if isinstance(val, (tuple, list, dict)):
        ...         pass
        ...     else:
        ...         val = val.replace('XXXX', 'CLIENT1')
        ...         section[newkey] = val
        >>> cfg.walk(transform, call_on_sections=True)
        {'CLIENT1section': {'CLIENT1key': None}}
        >>> cfg
        ConfigObj({'CLIENT1section': {'CLIENT1key': 'CLIENT1value'}})
        R)tcall_on_sections(trangeRvRt	ExceptionRPRtwalk(	R?tfunctionR)RtkeywargstoutRJRR((s-/usr/lib/python2.7/dist-packages/configobj.pyRJs:/







cCs||}|tkrtS|tkr*tSy6t|tjsKtn|jj|jSWn!tk
rt	d|nXdS(s_
        Accepts a key as input. The corresponding value must be a string or
        the objects (``True`` or 1) or (``False`` or 0). We allow 0 and 1 to
        retain compatibility with Python 2.2.
        
        If the string is one of  ``True``, ``On``, ``Yes``, or ``1`` it returns 
        ``True``.
        
        If the string is one of  ``False``, ``Off``, ``No``, or ``0`` it returns 
        ``False``.
        
        ``as_bool`` is not case sensitive.
        
        Any other input will raise a ``ValueError``.
        
        >>> a = ConfigObj()
        >>> a['a'] = 'fish'
        >>> a.as_bool('a')
        Traceback (most recent call last):
        ValueError: Value "fish" is neither True nor False
        >>> a['b'] = 'True'
        >>> a.as_bool('b')
        1
        >>> a['b'] = 'off'
        >>> a.as_bool('b')
        0
        s$Value "%s" is neither True nor FalseN(
RORPRVRRRRt_boolsRR(R?RwR((s-/usr/lib/python2.7/dist-packages/configobj.pytas_bools

cCst||S(si
        A convenience method which coerces the specified value to an integer.
        
        If the value is an invalid literal for ``int``, a ``ValueError`` will
        be raised.
        
        >>> a = ConfigObj()
        >>> a['a'] = 'fish'
        >>> a.as_int('a')
        Traceback (most recent call last):
        ValueError: invalid literal for int() with base 10: 'fish'
        >>> a['b'] = '1'
        >>> a.as_int('b')
        1
        >>> a['b'] = '3.2'
        >>> a.as_int('b')
        Traceback (most recent call last):
        ValueError: invalid literal for int() with base 10: '3.2'
        (tint(R?Rw((s-/usr/lib/python2.7/dist-packages/configobj.pytas_intscCst||S(s>
        A convenience method which coerces the specified value to a float.
        
        If the value is an invalid literal for ``float``, a ``ValueError`` will
        be raised.
        
        >>> a = ConfigObj()
        >>> a['a'] = 'fish'
        >>> a.as_float('a')  #doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ValueError: invalid literal for float(): fish
        >>> a['b'] = '1'
        >>> a.as_float('b')
        1.0
        >>> a['b'] = '3.2'
        >>> a.as_float('b')  #doctest: +ELLIPSIS
        3.2...
        (RT(R?Rw((s-/usr/lib/python2.7/dist-packages/configobj.pytas_floatscCs0||}t|ttfr)t|S|gS(sU
        A convenience method which fetches the specified value, guaranteeing
        that it is a list.
        
        >>> a = ConfigObj()
        >>> a['a'] = 1
        >>> a.as_list('a')
        [1]
        >>> a['a'] = (1,)
        >>> a.as_list('a')
        [1]
        >>> a['a'] = [1]
        >>> a.as_list('a')
        [1]
        (RVRMRB(R?Rwtresult((s-/usr/lib/python2.7/dist-packages/configobj.pytas_lists

cCsF|j|}tj|||||jkrB|jj|n|S(s
        Restore (and return) default value for the specified key.
        
        This method will only work for a ConfigObj that was created
        with a configspec and has been validated.
        
        If there is no default value for this key, ``KeyError`` is raised.
        (RRRRR(R?RwR((s-/usr/lib/python2.7/dist-packages/configobj.pytrestore_defaults
	
cCsGx|jD]}|j|q
Wx|jD]}||jq+WdS(s'
        Recursively restore default values to all members
        that have them.
        
        This method will only work for a ConfigObj that was created
        with a configspec and has been validated.
        
        It doesn't delete or modify entries without default values.
        N(RRRtrestore_defaults(R?RwRp((s-/usr/lib/python2.7/dist-packages/configobj.pyRs
N((R:R;RjRRR4RhRRRRPRRRRRRRRRRRRRRt__iter__RRt__str__RRRRORRRRRRR(((s-/usr/lib/python2.7/dist-packages/configobj.pyRsH					;												
				T	,				cBsFeZdZejdejZejdejZejdejZejdejZ	ejdejZ
ejdZejdZejdZ
ejd	Ziee
fd
6eefd6Zied6ed
6ed6ed6ed6ed6ed6ed6Zd/d/d/d/eeeeeed/d/eeedZdZd/dZdZdZdZdZdZdZdZdZdZd Z ed!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d/d/d+Z+eed/d,Z,d-Z-d.Z.RS(0s2An object to read, create, and write config files.s^ # line start
        (\s*)                   # indentation
        (                       # keyword
            (?:".*?")|          # double quotes
            (?:'.*?')|          # single quotes
            (?:[^'"=].*?)       # no quotes
        )
        \s*=\s*                 # divider
        (.*)                    # value (including list values and comments)
        $   # line end
        s=^
        (\s*)                     # 1: indentation
        ((?:\[\s*)+)              # 2: section marker open
        (                         # 3: section name open
            (?:"\s*\S.*?\s*")|    # at least one non-space with double quotes
            (?:'\s*\S.*?\s*')|    # at least one non-space with single quotes
            (?:[^'"\s].*?)        # at least one non-space unquoted
        )                         # section name close
        ((?:\s*\])+)              # 4: section marker close
        \s*(\#.*)?                # 5: optional comment
        $s^
        (?:
            (?:
                (
                    (?:
                        (?:
                            (?:".*?")|              # double quotes
                            (?:'.*?')|              # single quotes
                            (?:[^'",\#][^,\#]*?)    # unquoted
                        )
                        \s*,\s*                     # comma
                    )*      # match all list items ending in a comma (if any)
                )
                (
                    (?:".*?")|                      # double quotes
                    (?:'.*?')|                      # single quotes
                    (?:[^'",\#\s][^,]*?)|           # unquoted
                    (?:(?<!,))                      # Empty value
                )?          # last item in a list - or string value
            )|
            (,)             # alternatively a single comma - empty list
        )
        \s*(\#.*)?          # optional comment
        $s
        (
            (?:".*?")|          # double quotes
            (?:'.*?')|          # single quotes
            (?:[^'",\#]?.*?)       # unquoted
        )
        \s*,\s*                 # comma
        s^
        (
            (?:".*?")|          # double quotes
            (?:'.*?')|          # single quotes
            (?:[^'"\#].*?)|     # unquoted
            (?:)                # Empty value
        )
        \s*(\#.*)?              # optional comment
        $s^'''(.*?)'''\s*(#.*)?$s^"""(.*?)"""\s*(#.*)?$s^(.*?)'''\s*(#.*)?$s^(.*?)"""\s*(#.*)?$s'''s"""tyestnotontofft1t0ttruetfalsecCs||_tj||d||p(g}i|d6|d6|d6|d6|d6|d6|	d6|
d	6|d
6|d6|
d6|d
6}|dkr|}nddl}|jdtx-|D]%}|tkrtd|qqWx\t	tj
D]H\}}||kr|||<n||}||kr|||<qqW|rXt|d<n|j||d}||_
|j||dS(s
        Parse a config file or create a config file object.
        
        ``ConfigObj(infile=None, configspec=None, encoding=None,
                    interpolation=True, raise_errors=False, list_values=True,
                    create_empty=False, file_error=False, stringify=True,
                    indent_type=None, default_encoding=None, unrepr=False,
                    write_empty_values=False, _inspec=False)``
        iR-RR(R)R*R+R,R.R/R0R1R2iNsUPassing in an options dictionary to ConfigObj() is deprecated. Use **options instead.sUnrecognised option "%s".(t_inspecRRhR4twarningstwarntDeprecationWarningtOPTION_DEFAULTSRURBRRPRt_original_configspect_load(R?tinfiletoptionsR-RR(R)R*R+R,R.R/R0R1R2Rt_optionsRRREt
keyword_value((s-/usr/lib/python2.7/dist-packages/configobj.pyRhs<	

		





	cst|tjr||_tjj|rZt|d}|jpNg}WdQXq|j	ryt
d|jq|jrt|d}|jdWdQXng}nt|t
tfrt
|}nt|trbt|trfd||nx|D]}||||<qW|`|dk	rU|j|n	d|_dSt|dttk	r|jpg}ntd|r|j|}x\|D]Q}|s|ddkrqnx*dD]"}|j|r||_PqqWPqWntd|Ds7tt|g|D]}|jd^q>}|j ||jrd
|jdj!}t"|jdkrd|}	t#|	}
n
|jd}
|j|
_$||
_%|
n|`|dkrd|_n
|j|dS(NtrbsConfig file not found: "%s".twRdcsYx|jD]}||||<q
Wx0|jD]%}i||<||||q,WdS(N(RR(t
in_sectiontthis_sectionRRp(tset_section(s-/usr/lib/python2.7/dist-packages/configobj.pyRs

treads>infile must be a filename, file like object, or list of lines.is
s
s
css!|]}t|tjVqdS(N(RVRR(t.0Re((s-/usr/lib/python2.7/dist-packages/configobj.pys	<genexpr>ssat line %s.iis2Parsing failed with several errors.
First error %s(s
s
(s
s
s
(&RVRRtfilenametostpathtisfiletopent	readlinesR,RkR+twriteRBRMRRt_errorsR4t_handle_configspecR-R\RRRUt_handle_bomtendswithtnewlinestalltAssertionErrorRtrstript_parseRfRvRterrorstconfig(R?RR-thtcontentRReR~tinfoRmterror((Rs-/usr/lib/python2.7/dist-packages/configobj.pyRsj				
	

	("
	

		cCs	|dkrt}nd|_g|_|d|_|d|_|d|_|d|_|d|_|d|_	|d|_
|d|_|d	|_t
|_d|_|d
|_|d|_g|_g|_d|_|jrt
|_ntj|dS(NR)R(R*R+R,R.R/RR0R2R1(R4RR	RR)R(R*R+R,R.R/RR0RPtBOMRR2R1tinitial_commentt
final_commentR-RRR(R?R((s-/usr/lib/python2.7/dist-packages/configobj.pyR0s.			








		

				c	sYfd}ddjgjjD](}dt|t||f^q)S(Ncs1y|SWntk
r,tj|SXdS(N(R RR(Rw(R?(s-/usr/lib/python2.7/dist-packages/configobj.pyRQs
sConfigObj({%s})s, s%s: %s(RuRRR(R?RRw((R?s-/usr/lib/python2.7/dist-packages/configobj.pyRPs	cCs	|jdk	r7|jjtkr7|j||jSt|ttfrY|d}n|}t|tj	r|j||jS|jdk	rt|jj}|dkrxQtt
jD]=\}\}}|sqn|j|r|j||SqW|j||jSt
|}|j|sE|j||jS|t|}t|ttfrw||d<n|}t|_|j||jSx	tt
jD]\}\}}t|tjs|j|rqq||_|st|_|t|}t|ttfr1||d<n|}t|tj	rV|jtSt|tjr~|jdjtS|j|dSn|j||SqWtjrt|tr|j|dSt|tjr|jdjtS|j|dSdS(s1
        Handle any BOM, and decode if necessary.
        
        If an encoding is specified, that *must* be used - but the BOM should
        still be removed (and the BOM attribute set).
        
        (If the encoding is wrongly specified, then a BOM for an alternative
        encoding won't be discovered or removed.)
        
        If an encoding is not specified, UTF8 or UTF16 BOM will be detected and
        removed. The BOM attribute will be set. UTF16 will be decoded to
        unicode.
        
        NOTE: This method must not be called with an empty ``infile``.
        
        Specifying the *wrong* encoding is likely to cause a
        ``UnicodeDecodeError``.
        
        ``infile`` must always be returned as a list of lines, but may be
        passed in as a single string.
        iRsutf-8N(RR4RRt_decodeRVRBRMRt	text_typetBOMSRt
startswithtBOM_SETRvRORtbinary_typet
splitlinestdecodetPY2tstr(R?RRetencRRtfinal_encodingtnewline((s-/usr/lib/python2.7/dist-packages/configobj.pyR[s^
%

	%#		

cCs3t|tjr+|jr+|j|jS|SdS(s@Decode ASCII strings to unicode if a self.encoding is specified.N(RVRR'RR)(R?taString((s-/usr/lib/python2.7/dist-packages/configobj.pyt_a_to_uscCst|tjr|jtSt|tjr]|rM|j|jtS|jtSn|rxEt|D]4\}}t|tjrp|j|||<qpqpWn|S(s
        Decode infile to unicode. Using the specified encoding.
        
        if is a string, it also needs converting to a list.
        (RVRRR(ROR'R)t	enumerate(R?RRRJRe((s-/usr/lib/python2.7/dist-packages/configobj.pyR"s
cCs3t|tjr+|jr+|j|jS|SdS(s'Decode element to unicode if necessary.N(RVRR'R0R)(R?Re((s-/usr/lib/python2.7/dist-packages/configobj.pyt_decode_elementscCs$t|tjst|S|SdS(sh
        Used by ``stringify`` within validate, to turn non-string values
        into strings.
        N(RVRRR+(R?RE((s-/usr/lib/python2.7/dist-packages/configobj.pyt_strs
cCs_|j}|jrt|_ng}t}|}t|d}d}t}x||kr|rjg}n|d7}||}	|	j}
|
s|
jdrt}|j|	qOn|s||_g}t}nt}|j	j
|	}|dk	r|j\}}
}}}|r7|j
dkr7||_
n|
jd}||jdkrw|jdt||qOn||jkry|j||j}Wqtk
r|jdt||qOqXnP||jkr|j}n5||jdkr|}n|jdt||qO|j|}||krV|jd	t||qOnt|||d
|}|||<||j|<||j|<qOn|jj
|	}|dkr|jdj|	t||qO|j\}}}|r|j
dkr||_
n|d dkry%|j||||\}}}Wn*tk
ro|jdt||qOqX|jrd}yt|}Wqtk
r}t|t krd}nd}|j|t!||qOqXqn|jrTd}yt|}Wqtk
rP}t"|t r.d}nd}|j|t!||qOqXnFy|j#|\}}Wn*tk
r|jdt||qOnX|j|}||kr|jdt||qOn|j$||dt||j|<||j|<qOqOW|j
dkr#d|_
n|r@|jr@||_n|sR||_%n||_dS(sActually parse the config file.iit#t[t]s Cannot compute the section depthsCannot compute nesting levelsSection too nestedsDuplicate section nameRQs=Invalid line ({0!r}) (matched as neither section nor keyword)is"""s'''sParse error in multiline valueRdsUnknown name or type in values+Parse error from unrepr-ing multiline values!Parse error from unrepr-ing valuesParse error in valuesDuplicate keyword nameR1N(s"""s'''(&R*R1RPRvtstripR%RR ROt_sectionmarkerRyR4tgroupsR/tcountt
_handle_errorRRt_match_depthR^Rgt_unquoteRRRRt_keywordtformatRt
_multilineRttypeR$R#RVt
_handle_valueRR!(R?Rttemp_list_valuestcomment_listt
done_startRtmaxlinet	cur_indext
reset_commentRetslinetmattindentt	sect_opent	sect_namet
sect_closetcommentt	cur_depthR^RwREteRm((s-/usr/lib/python2.7/dist-packages/configobj.pyRs			


			
	
	

		
	
	




		
		





cCsZx7||jkr9||jkr-tn|j}qW|j|krM|StdS(s
        Given a section and a depth level, walk back through the sections
        parents to see if the depth level matches a previous section.
        
        Return a reference to the right section,
        or raise a SyntaxError.
        N(RR^Rg(R?tsectR((s-/usr/lib/python2.7/dist-packages/configobj.pyR<s
cCs^||}|d7}dj||}||||}|jrJ|n|jj|dS(s
        Handle an error according to the error settings.
        
        Either raise the error or store it.
        The error will have occured at ``cur_index``
        is{0} at line {1}.N(R?R)RR(R?ttextt
ErrorClassRRGReRiR((s-/usr/lib/python2.7/dist-packages/configobj.pyR;s

		cCsG|stn|d|dkrC|ddkrC|dd!}n|S(s%Return an unquoted version of a valueiit"t'i(RURV(Rg(R?RE((s-/usr/lib/python2.7/dist-packages/configobj.pyR=s
	$c	Cs@|r|jr|dkrdS|rt|ttfr|sDdSt|dkrq|j|ddtdSdjg|D]}|j|dt^q~St|tj	s|j
rt|}qtd|n|sdS|j
od	|kod
|k}|o0d|kr'd|kp0d	|k}|oa|oad|koad|koad
|k}|sq|ou|}|r|j
st}qd	|krtd
|q|dtkr|dtkrd|krt}q|j|}n|j|}|tkr8d
|kr8|j
r8|j|}n||S(s
        Return a safely quoted version of a value.
        
        Raise a ConfigObjError if the value cannot be safely quoted.
        If multiline is ``True`` (default) then use triple quotes
        if necessary.
        
        * Don't quote values that don't need it.
        * Recursively quote members of a list and return a comma joined list.
        * Multiline is ``False`` for lists.
        * Obey list syntax for empty and single member lists.
        
        If ``list_values=False`` then the value is only quoted if it contains
        a ``\n`` (is multiline) or '#'.
        
        If ``write_empty_values`` is set, and the value is an empty string, it
        won't be quoted.
        Rdt,iit	multilines, sValue "%s" is not a string.s""s
R4RVRUs#Value "%s" cannot be safely quoted.i(R2RVRBRMRvt_quoteRPRuRRR.R+RUR*tnoquotRtwspace_plust_get_single_quotet_get_triple_quote(	R?RERXRtno_lists_no_quotestneed_triplethash_triple_quotetcheck_for_singletquot((s-/usr/lib/python2.7/dist-packages/configobj.pyRYsB	&	"*1			!cCsJd|kr+d|kr+td|nd|kr@t}nt}|S(NRVRUs#Value "%s" cannot be safely quoted.(Rtsquottdquot(R?RERb((s-/usr/lib/python2.7/dist-packages/configobj.pyR\%s	cCse|jddkr=|jddkr=td|n|jddkr[t}nt}|S(Ns"""is'''s#Value "%s" cannot be safely quoted.(tfindRttdquotttsquot(R?RERb((s-/usr/lib/python2.7/dist-packages/configobj.pyR]/s*	c	Cs||jr|dfS|jsP|jj|}|dkrFtn|jS|jj|}|dkrztn|j\}}}}|dkr|dkrtn|dk	rg|fS|dk	r|r|rd}q|pd}|j|}n|dkr"||fS|j	j
|}g|D]}|j|^q;}|dk	rr||g7}n||fS(s
        Given a value string, unquote, remove comment,
        handle lists. (including empty and single member lists)
        Rds""N(RR*t_nolistvalueRyR4RgR9t	_valueexpR=t
_listvalueexptfindall(	R?RERJR*tsinglet
empty_listRORR((s-/usr/lib/python2.7/dist-packages/configobj.pyRB9s6	
	


	
"c
Cs<|d }|d}|j|d}|j|d}|j|}	|	dk	rtt|	j}
|
j||
S|j|dkrtnxZ||kr|d7}|d7}||}|j|dkr||7}qPqWt|j|}	|	dkrtn|	j\}}||||fS(s9Extract the value, where we are in a multiline situation.iiiis
N(t
_triple_quoteRyR4RBR9RReRg(
R?RERRGRFRbtnewvaluetsingle_linet
multi_lineRJtretvalReRO((s-/usr/lib/python2.7/dist-packages/configobj.pyR@js0






	cCst|ts|y"t|dtdtdt}Wq|tk
rV}td|q|tk
rx}td|q|Xn||_dS(sParse the configspec.R)R,RsParsing configspec failed: %ssReading configspec failed: %sN(RVRRORRRkR-(R?R-RQ((s-/usr/lib/python2.7/dist-packages/configobj.pyRs	
cCs|j}|jd}t|trZx0|jD]"}||kr1|||_q1q1Wnx|jD]}|dkr|qdn||kri||<t||_|r|jj|g|j|<|jj|d|j|<qnt||t	rd||||_qdqdWdS(s
        Called by validate. Handles setting the configspec on subsections
        including sections to be validated by __many__
        t__many__RdN(
R-RRVRRRORRRR(R?RptcopyR-tmanyR((s-/usr/lib/python2.7/dist-packages/configobj.pyt_set_configspecs"	

"cCsq|js$|j|j|}nt|}d||j|j|dt|jd||j|fS(s.Write an individual line, for the write methods
%s%s%s%s%sRXs = (R1R2RYRRPR0(R?t
indent_stringRRROR((s-/usr/lib/python2.7/dist-packages/configobj.pyt_write_lines	cCsRd||jd||j|j|dt|jd||j|fS(sWrite a section marker lines
%s%s%s%s%sR5RXR6(R0RYR2RP(R?RwRRRO((s-/usr/lib/python2.7/dist-packages/configobj.pyt
_write_markers
cCs@|s
dS|j}|jds8||jd7}n||S(sDeal with a comment.RdR4s # (R/R%R0(R?ROR}((s-/usr/lib/python2.7/dist-packages/configobj.pyt_handle_comments	cCss|jdkrt|_ng}|jd}|jd}|dkr|j}t|_|}x_|jD]Q}|j|}|j}|r|j	|r||}n|j
|qmWn|j|j}	x|j|j
D]}
|
|jkrqnx^|j|
D]O}|j|j}|rM|j	|rM||}n|j
|	|qW||
}|j|j|
}
t|tr|j
|j|	|j|
|
|j|jd|q|j
|j|	|
||
qW||krix\|jD]Q}|j|}|j}|rL|j	|rL||}n|j
|qW||_n||k	ry|S|jdkr*|dkr*|jrg|D]}|j|j^q}n|jr&|jdkstj|jj dkr&|s|j
dnt!|d|d<n|S|j"p9t#j$}t%|dddk	r|j&dkrt'j(d	kr|d
krd}n|j|j)|}|j*|s||7}nt|t+j,r|}n!|j|jp|j-pd}|jr+|jdkst.|jr+t!|}n|dk	rG|j|n(t/|jd
}|j|WdQXdS(s~
        Write the current ConfigObj as a file
        
        tekNico: FIXME: use StringIO instead of real files
        
        >>> filename = a.filename
        >>> a.filename = 'test.ini'
        >>> a.write()
        >>> a.filename = filename
        >>> a == ConfigObj('test.ini', raise_errors=True)
        1
        >>> import os
        >>> os.remove('test.ini')
        R4s# RpRRditmodeRtwin32s
s
tasciitwbN(0R/R4RR0R(RPR R2R7R%RRRRRRtlstripRzRRVRRytextendRRxR!R	RtencodeRRRRRRR
tlinesepR\R{tsystplatformRuRRR'R0RR
(R?toutfileRpRtcstcsptint_valRet
stripped_lineRwRtcomment_lineRROtlR.toutputtoutput_bytesR((s-/usr/lib/python2.7/dist-packages/configobj.pyRs		




	('	
			'
c
sdkrjdkr*tdnrLddlm}|_nrjj_jj_jj_jj	_	jj
_
jj_qnjjfd}it
}t
}gjD]}	|	kr|	^q}
gjD]}	|	jkr6|	^q6}gjD]}	|	jkra|	^qa}xjD]}
|
dkrqn|
jks|
jkr!t
}d}r1|
jkr1jj|
gj|
<jj|
dj|
<q1nt}|
}||
|
||||\}}qWd}djkr|d}ndjkrd}n|dk	rx9|
D]1}
|
}||
||t||\}}qWg}
nxJ|D]B}
t}st|
<qt}d|
}j||
<qWxJ|D]B}
t}s\t|
<q=t}d	|
}j||
<q=WxjD]}
kr|
d
krqn|
jdkr|
j|
qnrjj|
gj|
<jj|
dj|
<njddd
|
}||
<|tkr\t}q|t
krqt}qt}qW|
_rjrt}n|rrrtj}n|rt
S|rtSS(s;
        Test the ConfigObj against a configspec.
        
        It uses the ``validator`` object from *validate.py*.
        
        To run ``validate`` on the current ConfigObj, call: ::
        
            test = config.validate(validator)
        
        (Normally having previously passed in the configspec when the ConfigObj
        was created - you can dynamically assign a dictionary of checks to the
        ``configspec`` attribute of a section though).
        
        It returns ``True`` if everything passes, or a dictionary of
        pass/fails (True/False). If every member of a subsection passes, it
        will just have the value ``True``. (It also returns ``False`` if all
        members fail).
        
        In addition, it converts the values from strings to their native
        types if their checks pass (and ``stringify`` is set).
        
        If ``preserve_errors`` is ``True`` (``False`` is default) then instead
        of a marking a fail with a ``False``, it will preserve the actual
        exception object. This can contain info about the reason for failure.
        For example the ``VdtValueTooSmallError`` indicates that the value
        supplied was too small. If a value (or section) is missing it will
        still be marked as ``False``.
        
        You must have the validate module to use ``preserve_errors=True``.
        
        You can then use the ``flatten_errors`` function to turn your nested
        results dictionary into a flattened list of failures - useful for
        displaying meaningful error messages.
        sNo configspec supplied.i(tVdtMissingValuec	sjj|dyj|j|<Wnttjfk
rPnXyj||d|}WnRjk
r}st|j	rt
|<n||<t
}t
}nXt
}t|<js|rsjsQt|t
tfr$g|D]}j|^q}qQ|r?|dkr?d}qQj|}n||ksc|rs||<qsnr|r|jkrjj|n||fS(NtmissingRd(RRR4tget_default_valueRRtbaseErrorClasstcheckRVt_vdtMissingValueRPROR.RBRMR3RR(	RtspecRRtret_truet	ret_falseRRQtitem(R-RtRtpreserve_errorsRpR?t	validator(s-/usr/lib/python2.7/dist-packages/configobj.pytvalidate_entrys:	




	%	Rst
___many___Rds"Value %r was provided as a sections)Section %r was provided as a single valueRRRtRpN(s__many__R(R4R-RtvalidateRRR R!RRRR/RvRORRRRRRRPRRRRtanyR(R?RRRtRpRRRRRztunvalidatedtincorrect_sectionstincorrect_scalarsRRRRuRmR((R-RtRRRpR?Rs-/usr/lib/python2.7/dist-packages/configobj.pyRSs$	!-(++"




	






%
		
		cCs*|j|jd|_d|_dS(s@Clear ConfigObj instance and restore to 'freshly created' state.N(RRR4R-R(R?((s-/usr/lib/python2.7/dist-packages/configobj.pytreset"	s

	cCst|jtjs!tn|j}i}x3tD]+}|dkrOq7nt||||<q7W|j}||d<|j|j	||j
||dS(s
        Reload a ConfigObj from file.
        
        This method raises a ``ReloadError`` if the ConfigObj doesn't have
        a filename attribute pointing to a file.
        R-N(RVR	RRR"RR\RRRR(R?R	tcurrent_optionsRR-((s-/usr/lib/python2.7/dist-packages/configobj.pytreload-	s	
	


N(/R:R;RjRRRR>R8RiRjRht_single_line_singlet_single_line_doublet_multi_line_singlet_multi_line_doubleRnRORPRR4RhRRRRR0R"R2R3RR<R;R=RYR\R]RBR@RRvRxRyRzRRRR(((s-/usr/lib/python2.7/dist-packages/configobj.pyR/sx


			6	` 		u					
				
G	
	
	1	#						r	cBs#eZdZdZedZRS(s
    A simple validator.
    Can be used to check that all members expected are present.
    
    To use it, provide a configspec with all your members in (the value given
    will be ignored). Pass an instance of ``SimpleVal`` to the ``validate``
    method of your ``ConfigObj``. ``validate`` will return ``True`` if all
    members are present, or a dictionary with True/False meaning
    present/missing. (Whole missing sections will be replaced with ``False``)
    cCs
t|_dS(N(RR(R?((s-/usr/lib/python2.7/dist-packages/configobj.pyRhS	scCs|r|jn|S(s9A dummy check method, always returns the value unchanged.(R(R?RtmemberR((s-/usr/lib/python2.7/dist-packages/configobj.pyRV	s(R:R;RjRhRPR(((s-/usr/lib/python2.7/dist-packages/configobj.pyRG	s
	cCs+|dkrg}g}n|tkr1t|S|tksLt|tr|j|d|f|rv|jnt|Sxt|j	D]w\}}|tkrqnt|j
|tr|j|t|||||qn|j|||fqW|r!|jnt|S(s
    An example function that will turn a nested dictionary of results
    (as returned by ``ConfigObj.validate``) into a flat list.
    
    ``cfg`` is the ConfigObj instance being checked, ``res`` is the results
    dictionary returned by ``validate``.
    
    (This is a recursive function, so you shouldn't use the ``levels`` or
    ``results`` arguments - they are used by the function.)
    
    Returns a list of keys that failed. Each member of the list is a tuple::
    
        ([list of sections...], key, result)
    
    If ``validate`` was called with ``preserve_errors=False`` (the default)
    then ``result`` will always be ``False``.

    *list of sections* is a flattened list of sections that the key was found
    in.
    
    If the section was missing (or a section was expected and a scalar provided
    - or vice-versa) then key will be ``None``.
    
    If the value (or section) was missing then ``result`` will be ``False``.
    
    If ``validate`` was called with ``preserve_errors=True`` and a value
    was present, but failed the check, then ``result`` will be the exception
    object returned. You can use this as a string that describes the failure.
    
    For example *The value "3" is of the wrong type*.
    N(
R4ROtsortedRPRVRRRRBRRRR%(tcfgtrestlevelstresultsRwR((s-/usr/lib/python2.7/dist-packages/configobj.pyR%]	s* 	




cCszg}|jg|jD]}||f^qxD|jD]9}||jkr9|jt||||fq9q9W|S(s
    Find all the values and sections not in the configspec from a validated
    ConfigObj.
    
    ``get_extra_values`` returns a list of tuples where each tuple represents
    either an extra section, or an extra value.
    
    The tuples contain two values, a tuple representing the section the value 
    is in and the name of the extra values. For extra values in the top level
    section the first member will be an empty tuple. For values in the 'foo'
    section the first member will be ``('foo',)``. For members in the 'bar'
    subsection of the 'foo' section the first member will be ``('foo', 'bar')``.
    
    NOTE: If you call ``get_extra_values`` on a ConfigObj instance that hasn't
    been validated it will return an empty list.
    (RRRR&(tconft_prependRRQ((s-/usr/lib/python2.7/dist-packages/configobj.pyR&	s)((>R
RRtcodecsRRRRRt_versionRR4R3R$RR&RRcRdRZR[RgRftobjectRt__all__RRtMAX_INTERPOL_DEPTHRORPRR9RR$R<t_builderR1RgRRRRkR"RRRRR!R R#RnRRRRRRRRR%R&(((s-/usr/lib/python2.7/dist-packages/configobj.pyt<module>s"




			
		7					|
	g<

Copyright © 2017 || Recoded By Mr.Bumblebee