403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/configobj/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/configobj/__pycache__/__init__.cpython-314.pyc
+
�3i�[���^RIt^RIt^RIt^RIHtHtHtHt^RIH	t	Rs
]RV]RW]RX]RY/tRRRRR	RR
RRRRRRRRRR
RRRRRRRRRRRRR/tR]R]R]R]R]/t
RtRtRtRtRtRtRt]!4tRZtR(tR)t^
tR*R+R,R-R.R+R/R-R0R-R1RR2R+R3RR4RR5RR6R-R7R-/tR8t!R9R']4t!R:R;]4t]!4t R<t!!R=R]"4t#!R>R]#4t$!R?R]#4t%!R@R%]&4t'!RAR]#4t(!RBR]#4t)!RCR!]#4t*!RDR"]*4t+!RER$]#4t,!RFR#]*4t-!RGR&]#4t.!RHRI]4t/!RJRK]/4t0!RLRM]/4t1R(]0RN]1/t2ROt3!RPRQ]44t5!RRR]54t6!RSR ]4t7R[RTlt8R\RUlt9R#)]�N)�BOM_UTF8�	BOM_UTF16�BOM_UTF16_BE�BOM_UTF16_LE)�__version__�utf_8�utf16_be�utf_16�utf16_le�u16�utf16zutf-16�	utf_16_bezutf-16be�	utf_16_lezutf-16le�u8�utf�utf8�utf-8c�N�\PVP44R8H#)r)�BOM_LIST�get�lower)�encodings&�4/usr/lib/python3/dist-packages/configobj/__init__.py�
match_utf8rCs���<�<����(�)�W�4�4�z'%s'z"%s"z%sz 
	'"z"""%s"""z'''%s'''�ConfigObjError�NestingError�
ParseError�DuplicateError�ConfigspecError�	ConfigObj�	SimpleVal�InterpolationError�InterpolationLoopError�MissingInterpolationOption�RepeatSectionError�ReloadError�UnreprError�UnknownType�configparserz    �
interpolationT�raise_errorsF�list_values�create_empty�
file_error�
configspec�	stringify�indent_typer�default_encoding�unrepr�write_empty_valuesc���\f^RIsRV,p\PV4pVP4^,P4^,P4^,#)Nza=)�compiler�parse�getChildren)�s�ps& r�getObjr<{sO������q��A����q��A��=�=�?�1��)�)�+�A�.�:�:�<�Q�?�?rc��]tRt^�tRtR#)r)�N)�__name__�
__module__�__qualname__�__firstlineno__�__static_attributes__r>rrr)r)�s��rc�\a�]tRt^�toRtRtRtRtRtRt	Rt
RtR	tR
t
RtVtR#)
�Builderc�f�\f \VPP4h\V4#�N)�mr)�	__class__r?��self�os&&r�build�
Builder.build�s%���9��a�k�k�2�2�3�3���t�rc�\�\\VPVP444#rG)�list�maprMr9rJs&&r�
build_List�Builder.build_List�s���C��
�
�A�M�M�O�4�5�5rc��VP#rG)�valuerJs&&r�build_Const�Builder.build_Const�s���w�w�rc��/p\\VPVP444pVFp\	V4W$&K	V#rG)�iterrQrMr9�next)rKrL�d�i�els&&   r�
build_Dict�Builder.build_Dict�s<������T�Z�Z�����1�2���B���G�A�E���rc�6�\VPV44#rG)�tuplerRrJs&&r�build_Tuple�Builder.build_Tuple�s���T�_�_�Q�'�(�(rc��VPR8XdR#VPR8XdR#VPR8XdR#\R4h)�NoneN�TrueT�FalseFzUndefined Name)�namer)rJs&&r�
build_Name�Builder.build_Name�s=���6�6�V����6�6�V����6�6�W����*�+�+rc� �\\VPVP444wr#\	V4p\T\4'dTPR8wd\
R4hY#,# \
d
\
R4hi;i)�Addg)
rPrQrVr9�float�	TypeErrorr)�
isinstance�complex�real)rKrLrq�imags&&  r�	build_Add�Builder.build_Add�sx���#�d�.�.��
�
��@�A�
��	%���;�D��$��(�(�D�I�I��,<��e�$�$��y���	�	%��e�$�$�	%�s�A6�6B
c�b�VPVP4p\W!P4#rG)rM�expr�getattr�attrname)rKrL�parents&& r�
build_Getattr�Builder.build_Getattr�s#�����A�F�F�#���v�z�z�*�*rc�P�VPVP4^,4)#�r�rVr9rJs&&r�build_UnarySub�Builder.build_UnarySub�s!��� � ������!3�4�4�4rc�N�VPVP4^,4#r}r~rJs&&r�build_UnaryAdd�Builder.build_UnaryAdd�s������
�
��� 2�3�3rr>N)r?r@rArBrMrRrVr^rbrirsrzrr�rC�__classdictcell__��
__classdict__s@rrErE�s<�����
6���)�	,��+�5�4�4rrEc�@�V'gV#^RIpVPV4#�rN)�ast�literal_eval)r:r�s& rr4r4�s ���������A��rc�.a�]tRt^�toRtRRltRtVtR#)rz_
This is the base class for all errors that ConfigObj raises.
It is a subclass of SyntaxError.
Nc�H�W0nW n\PW4R#rG)�line�line_number�SyntaxError�__init__)rK�messager�r�s&&&&rr��ConfigObjError.__init__�s���	�&�����T�+r)r�r�)�Nr��r?r@rArB�__doc__r�rCr�r�s@rrr�s�����,�,rc��]tRt^�tRtRtR#)rz=
This error indicates a level of nesting that doesn't match.
r>N�r?r@rArBr�rCr>rrrr����rc��]tRt^�tRtRtR#)rz�
This error indicates that a line is badly written.
It is neither a valid ``key = value`` line,
nor a valid section marker line.
r>Nr�r>rrrr�s��rc�*a�]tRt^�toRtRtRtVtR#)r'zK
A 'reload' operation failed.
This exception is a subclass of ``IOError``.
c�2�\PVR4R#)z#reload failed, filename is not set.N)�IOErrorr��rKs&rr��ReloadError.__init__�s������D�Err>Nr�r�s@rr'r'�s�����F�Frc��]tRt^�tRtRtR#)rz2
The keyword or section specified already exists.
r>Nr�r>rrrr�r�rc��]tRt^�tRtRtR#)r z/
An error occured whilst parsing a configspec.
r>Nr�r>rrr r �r�rc��]tRt^�tRtRtR#)r#z,Base class for the two interpolation errors.r>Nr�r>rrr#r#�s��6rc�*a�]tRt^�toRtRtRtVtR#)r$z=Maximum interpolation depth exceeded in string interpolation.c�@�\PVRV,4R#)z*interpolation loop detected in value "%s".N�r#r�)rK�options&&rr��InterpolationLoopError.__init__s���#�#��8�6�A�	Crr>Nr�r�s@rr$r$�s����G�C�Crc��]tRtRtRtRtR#)r&iz_
This error indicates additional sections in a section with a
``__many__`` (repeated) section.
r>Nr�r>rrr&r&s��rc�*a�]tRtRtoRtRtRtVtR#)r%i
z0A value specified for interpolation was missing.c�B�RV,p\PW4R#)z%missing option "%s" in interpolation.Nr�)rKr��msgs&& rr��#MissingInterpolationOption.__init__s��5��>���#�#�D�.rr>Nr�r�s@rr%r%
s����:�/�/rc��]tRtRtRtRtR#)r(iz An error parsing in unrepr mode.r>Nr�r>rrr(r(s��*rc�da�]tRtRtoRt]P!R4tRtRt	Rt
RtRtR	t
VtR
#)�InterpolationEngineiz�
A helper class to help perform string interpolation.

This class is an abstract base class; its descendants perform
the actual work.
�
%\(([^)]*)\)s�%c��WnR#rG��section)rKr�s&&rr��InterpolationEngine.__init__%s���rc�faa�SPV9gV#VV3RloS!WSP/4pV#)c�<�WP3V9d\V4h^W0VP3&S
PPV4pV'dS
P	V4wrVpVfTpM	S!WVWs4pVP4wr�RP
VRV	W�V
R34pV	\V4,pS
PPW4pK�W0VP3V#)a0The 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.
Nr�)rhr$�_KEYCRE�search�_parse_match�span�join�len)�keyrUr��	backtrail�match�k�vr:�replacement�start�end�new_search_start�recursive_interpolaterKs&&&&        ��rr��>InterpolationEngine.interpolate.<locals>.recursive_interpolate/s�����\�\�"�i�/�,�S�1�1�-.�I�G�L�L�)�*��L�L�'�'��.�E���+�+�E�2���a��9�"#�K�#8��a�"K�K�"�Z�Z�\�
������v����3�4�[� I�J��#(�3�{�+;�#;� ����+�+�E�D������-�.��Lr)�_cookier�)rKr�rUr�sf&&@r�interpolate�InterpolationEngine.interpolate*s3����|�|�u�$��L�(	�X&�c�$�,�,��C���rc��VPPPpRVPPnVPpVPV4pVe\	V\
4'gM[VPR/4PV4pVe\	V\
4'gMVPVJdMVPpK�W PPnVf\V4hWC3#)zxHelper function to fetch values from owning section.

Returns a 2-tuple: the value, and the section where it was found.
F�DEFAULT)r��mainr+rro�Sectionryr%)rKr��save_interp�current_section�vals&&   r�_fetch�InterpolationEngine._fetch_s����l�l�'�'�5�5��*/������'��,�,���!�%�%�c�*�C���z�#�w�'?�'?��!�%�%�i��4�8�8��=�C���z�#�w�'?�'?���%�%��8��-�4�4�O�+6�����'��;�,�S�1�1��#�#rc��\4h)aiImplementation-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 "$").
)�NotImplementedError)rKr�s&&rr�� InterpolationEngine._parse_match�s
�� "�#�#rr�N)r?r@rArBr��re�compiler�r�r�r�r�r�rCr�r�s@rr�r�s;������j�j�)�*�G��G��
2�j$�D$�$rr�c�Ra�]tRtRtoRtRt]P!R4tRt	Rt
VtR#)�ConfigParserInterpolationi�zBehaves like ConfigParser.r�r�c�R�VP^4pVPV4wr4W#V3#)�)�groupr��rKr�r�rUr�s&&   rr��&ConfigParserInterpolation._parse_match�s*���k�k�!�n�����S�)����7�"�"rr>N)r?r@rArBr�r�r�r�r�r�rCr�r�s@rr�r��s&����$��G��j�j�)�*�G�#�#rr�c�a�]tRtRtoRtRtRt]P!R]P]P,4tRtRt
VtR#)�TemplateInterpolationi�zBehaves like string.Template.�$z�
        \$(?:
          (?P<escaped>\$)              |   # Two $ signs
          (?P<named>[_a-z][_a-z0-9]*)  |   # $name format
          {(?P<braced>[^}]*)}              # ${name} format
        )
        c��VPR4;'gVPR4pVeVPV4wr4W#V3#VPR4eRVPR3#RVP4R3#)�named�bracedN�escaped)r�r��
_delimiterr�s&&   rr��"TemplateInterpolation._parse_match�st���k�k�'�"�;�;�e�k�k�(�&;���?�!�[�[��-�N�E��w�&�&��;�;�y�!�-�����$�.�.��U�[�[�]�D�(�(rr>N)r?r@rArBr�r�r�r�r��
IGNORECASE�VERBOSEr�r�rCr�r�s@rr�r��sA����'��G��J��j�j���]�]�R�Z�Z�
'�
)�G�)�)rr��templatec�*�VP!V.VO5!#rG)�__new__)�cls�argss&*r�
__newobj__r��s���;�;�s�"�T�"�"rc�a�]tRtRtoRtRtRtR%RltRtRt	R	t
R&R
ltRtR'Rlt
R
t]3RltRtRtR'RltRtRtRtRtRt]tRtRt]tR]nRtRtRtR(Rlt Rt!Rt"R t#R!t$R"t%R#t&R$t'Vt(R#))r�i�aE
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.
c��\PW^,4VPPV^,4R#r�)�dict�update�__dict__�rK�states&&r�__setstate__�Section.__setstate__�s(�����D��(�#��
�
���U�1�X�&rc�X�\V4VP3p\VP3V3#rG)r�r�r�rIr�s& r�
__reduce__�Section.__reduce__�s(���d��T�]�]�+���T�^�^�-�u�5�5rNc���Vf/p\PV4WnW0nW nWPnVP
4VP4F	wrgWpV&K	R#)z�
* 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)r�r�ryr��depthrh�_initialise�items)rKryr�r��indictrh�entryrUs&&&&&&  rr��Section.__init__�sU���>��F��
�
�d�����	��
��	�����#�L�L�N�L�E���K�+rc��.Vn.Vn/Vn/VnRVn.Vn/Vn.VnRVnR#)NF)	�scalars�sections�comments�inline_commentsr0�defaults�default_values�extra_values�_createdr�s&rr��Section._initialise�sD�������
���
�!��������
� ��������
rc�@�VPpTPY4# \dtTPPpTR8Xd\pTP4p\PTR4pTfRTPnTu#T!T4;q0nL�i;i)TNF)	�_interpolation_engine�AttributeErrorr�r+�DEFAULT_INTERPOLATIONr�interpolation_enginesrr�)rKr�rU�enginerh�class_s&&&   r�_interpolate�Section._interpolates���	C��/�/�F�"�!�!�#�-�-��!�	C��9�9�*�*�D��t�|�,���:�:�<�D�*�.�.�t�T�:�F��~�*/��	�	�'���7=�T�l�B��3�	C�s��A+B�B�Bc�>aa�\PSS4pSPP'dd\	V\
4'dSP
SV4#\	V\4'd&VV3RlpVUu.uF
qC!V4NK	ppWR8wdV#V#uupi)z+Fetch the item and do string interpolation.c�X<�\V\4'dSPSV4#V#rG)ro�strr)rr�rKs&��r�_check�#Section.__getitem__.<locals>._check*s(���!�%��-�-�#�0�0��e�<�<� �Lr)r��__getitem__r�r+rorrrP)rKr�r�rr�newsff    rr�Section.__getitem__#s�������t�S�)���9�9�"�"�"��#�s�#�#��(�(��c�2�2��#�t�$�$�!�36�6�#��v�e�}�#��6��:��J��
��7s�>Bc�@�\V\4'g\RV,4hWP9d.VPV&RVPV&WP
9dVP
P
V4\V\4'd:W9dVPPV4\PWV4R#\V\4'dnV'gfW9dVPPV4VP^,p\PVV\VVVPVVR74R#W9dVPPV4VPP'gx\V\4'dM`\V\ \"34'd3VF+p\V\4'dK\%RV,4h	M\%RV,4h\PWV4R#)aS
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.
zThe key "%s" is not a string.r�)rrhzValue is not a string "%s".N)ror�
ValueErrorrrr	�remover�r�appendr��__setitem__r�r�rr1rPrarn)rKr�rUr4�	new_depthrs&&&&  rr#�Section.__setitem__4s����#�s�#�#��<�s�B�C�C��m�m�#�!#�D�M�M�#��(*�D� � ��%��-�-���M�M� � ��%��e�W�%�%����
�
�$�$�S�)����T��.�
��t�
$�
$�V����
�
�$�$�S�)��
�
�Q��I����������I�I� ���
������#�#�C�(��9�9�&�&�&��e�S�)�)�����e�}�5�5�!&��)�%��5�5�"+�,I�E�,Q�"R�R�"'�$�$A�E�$I�J�J����T��.rc���\PW4WP9dVPPV4MVPPV4VP
VVPVR#)z-Remove items from the sequence when deleting.N)r��__delitem__rr!rrr�rKr�s&&rr'�Section.__delitem__osX�����$�$��,�,���L�L����$��M�M� � ��%��M�M�#��� � ��%rc�:�W,# \dTu#i;i)z>A version of ``get`` that doesn't bypass string interpolation.��KeyError�rKr��defaults&&&rr�Section.getzs#��	��9����	��N�	�s�
�
�c�,�VF
pW,W&K	R#)z4
A version of update that uses our ``__setitem__``.
Nr>)rKrrs&& rr��Section.update�s���E� �-�D�K�rc�Z�W,pWV# \dT\JdhTpT#i;i)z�
'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'
)r,�MISSING)rKr�r.r�s&&& r�pop�Section.pop�sB��
	��)�C��	��
��
�	��'�!���C��
�
	�s��*�*c��VPVP,pV'g\R4hV^,pW,pWW#3#)zPops the first (key,val)z": 'popitem(): dictionary is empty')rrr,)rK�sequencer�r�s&   r�popitem�Section.popitem�s?���L�L�4�=�=�0����?�@�@��q�k���y���I��x�rc��\PV4.Vn.Vn/Vn/VnRVn.Vn.VnR#)z�
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)	r��clearrrrrr0r	rr�s&rr;�
Section.clear�sC��	
�
�
�4�������
���
�!��������
���rc�N�W,# \dY T&Y,u#i;i)z:A version of setdefault that sets sequence if appropriate.r+r-s&&&r�
setdefault�Section.setdefault�s-��	��9����	���I��9��	�s�
�$�$c	��\\VPVP,\VP	4444#)z8D.items() -> list of D's (key, value) pairs, as 2-tuples)rP�ziprr�valuesr�s&rr�
Section.items�s,���C�����
�
�5��T�[�[�]�8K�L�M�Mrc�<�VPVP,#)zD.keys() -> list of D's keys�rrr�s&r�keys�Section.keys�s�����t�}�}�,�-rc�r�VPVP,Uu.uFqV,NK
	up#uupi)z D.values() -> list of D's valuesrEr(s& rrB�Section.values�s-��&*�l�l�T�]�]�&B�D�&B�c�S�	�	�&B�D�D��Ds�4c�F�\\VP444#)z=D.iteritems() -> an iterator over the (key, value) items of D)rYrPrr�s&r�	iteritems�Section.iteritems�s���D�����&�'�'rc�N�\VPVP,4#)z.D.iterkeys() -> an iterator over the keys of D)rYrrr�s&r�iterkeys�Section.iterkeys�s���T�\�\�D�M�M�1�3�3rc�F�\\VP444#)z2D.itervalues() -> an iterator over the values of D)rYrPrBr�s&r�
itervalues�Section.itervalues�s���D�����'�(�(rc
��a�V3RlpRRPSPSP,Uu.uF$p\V4:R\V!V44:2NK&	up4,#uupi)zx.__repr__() <==> repr(x)c�f<�SV,# \d\PST4u#i;irG�r%r�r�r�rKs&�r�_getval�!Section.__repr__.<locals>._getval��4���
3��C�y� ��-�
3��'�'��c�2�2�
3����!0�0z{%s}�, �: �r�rr�repr�rKrWr�sf  r�__repr__�Section.__repr__�sa���	3�
��	�	����t�}�}�4�#7�4��15�S�	�4����;M�$N�4�#7�8�8�	8��#7��*A*
zx.__str__() <==> str(x)c��/pVFypW,p\V\4'dVP4pMC\V\4'd
\V4pM!\V\4'd\	V4pW1V&K{	V#)z�
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
)ror�r�rPra)rK�newdictr�
this_entrys&   rr��Section.dict�so�����E���J��*�g�.�.�'�_�_�.�
��J��-�-�!�*�-�
��J��.�.�"�:�.�
�'�E�N���rc���\VP44FZwr#W 9dL\W,\4'd0\V\4'dW,P	V4KVW0V&K\	R#)a�
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)rPrror��merge)rKrr�r�s&&  rrh�
Section.mergesP��&�V�\�\�^�,�H�C���
�4�9�d� ;� ;� *�3�� 5� 5��	����$��S�	�-rc�"�WP9dVPpM/WP9dVPpM\RV,4hVPV4pW,p\PW4\P
WV4VPV4VPWB4VPV,pVPV,pVPVVPVW`PV&WpPV&R#)z�
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.
zKey "%s" not found.N)rrr,�indexr�r'r#r!�insertrr)rK�oldkey�newkey�the_list�posr��comm�inline_comments&&&     r�rename�Section.rename's����\�\�!��|�|�H�
�}�}�
$��}�}�H��0�6�9�:�:��n�n�V�$���l������&�����s�+����������$��}�}�V�$���-�-�f�5���M�M�&�!�� � ��(� $�
�
�f��'5���V�$rc�z�/p\\VP44F7pVPV,pV!W3/VBpVPV,pW�V&K9	\\VP44FZpVPV,pV'dV!W3/VBTPT,pW,P
!V3RVRV/VBWW&K\	V# \d%T'dhTPT,pRYW&K�i;i \d$T'dhTPT,pRYW&L�i;i)a8
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'}})
Fr,�call_on_sections)�ranger�r�	Exceptionr�walk)	rK�functionr,rv�keywargs�outr\rr�s	&&&&,    rry�Section.walkEs4��^���s�4�<�<�(�)�A��L�L��O�E�

'��t�7�h�7�����Q��� �E�
�
*��s�4�=�=�)�*�A��M�M�!�$�E��+��T�5�H�5��
�
�a�(����)�)���)��"2���	�C�J�+�&�
��5�
'��� �L�L��O�E�!&�C�J�
'��!�+�#�� $�
�
�a� 0��%*��
�+�s/� C�	D�D	�-D	�D	�D:�D:�9D:c��W,pVR8XdR#VR8XdR#\V\4'g\4hVPPVP4,# \d\
RT,4hi;i)a�
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
TFz$Value "%s" is neither True nor False)rorr,r��_boolsrr )rKr�r�s&& r�as_bool�Section.as_bool�sw��8�i���$�;��
�E�\��
O�!�#�s�+�+�"�*�$��9�9�+�+�C�I�I�K�8�8���
O� �!G�#�!M�N�N�
O�s�A
A'�'Bc�$�\W,4#)a�
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'
)�intr(s&&r�as_int�Section.as_int�s��(�4�9�~�rc�$�\W,4#)a�
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...
)rmr(s&&r�as_float�Section.as_float�s��&�T�Y��rc�f�W,p\V\\34'd\V4#V.#)z�
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]
)rorarP)rKr��results&& r�as_list�Section.as_list�s-�� ����f�u�d�m�,�,���<���x�rc��VPV,p\PWV4WP9dVPP	V4V#)z�
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.
)r
r�r#r	r"r-s&& r�restore_default�Section.restore_default	sE���%�%�c�*������G�,��m�m�#��M�M� � ��%��rc��VPFpVPV4K	VPFpW,P4K	R#)z�
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)r
r�r�restore_defaults)rKr�r�s&  rr��Section.restore_defaultss@���&�&�C�� � ��%�'��}�}�G��M�*�*�,�%r)rrrr0r
r	r�rrr�rhryrr�NN�FrG)TF))r?r@rArBr�r�r�r�r�rrr#r'rr�r3r4r8r;r>rrFrBrKrN�__iter__rQr`�__str__r�rhrsryr�r�r�r�r�r�rCr�r�s@rr�r��s������$'�6�
 �4�".�.�"8/�v&��(� '�
� ��$�N�
.�
E�
(�
4��H�)�
8��G�/�G�O�
�8 �66�<R�j)O�X�. �,�,
� -�-rr�c��a�]tRtRtoRt]P!R]P4t]P!R]P4t	]P!R]P4t
]P!R]P4t]P!R]P4t]P!R4t
]P!R	4t]P!R
4t]P!R4tR]
]3R
]]3/tRRRRRRRRRRRRRRRR/tR5RltRtR6RltRtRtRtRtR tR!tR"tR#tR$tR%tR7R&lt R't!R(t"R)t#R*t$R+t%R,t&R-t'R.t(R/t)R8R0lt*R9R1lt+R2t,R3t-R4t.Vt/R#):r!i*z2An object to read, create, and write config files.a�^ # line start
        (\s*)                   # indentation
        (                       # keyword
            (?:".*?")|          # double quotes
            (?:'.*?')|          # single quotes
            (?:[^'"=].*?)       # no quotes
        )
        \s*=\s*                 # divider
        (.*)                    # value (including list values and comments)
        $   # line end
        a=^
        (\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
        $a�^
        (?:
            (?:
                (
                    (?:
                        (?:
                            (?:".*?")|              # 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
        $z�
        (
            (?:".*?")|          # double quotes
            (?:'.*?')|          # single quotes
            (?:[^'",\#]?.*?)       # unquoted
        )
        \s*,\s*                 # comma
        a^
        (
            (?:".*?")|          # double quotes
            (?:'.*?')|          # single quotes
            (?:[^'"\#].*?)|     # unquoted
            (?:)                # Empty value
        )
        \s*(\#.*)?              # optional comment
        $z^'''(.*?)'''\s*(#.*)?$z^"""(.*?)"""\s*(#.*)?$z^(.*?)'''\s*(#.*)?$z^(.*?)"""\s*(#.*)?$�'''�"""�yesT�noF�on�off�1�0�true�falseNc�.�W�n\PW^V4T;'g.pRVRVRVRVRVRVRV	RV
R	VR
VRV
RV/pVfTpM�^R
IpVP	R\
^R7VF pV\9gK\RV,4h	\\P44F)wppVV9dVVV&VV,pVV8wgK$VVV&K+	V'dRVR&VPV4VR,pW0nVPW4R
#)aq
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)``
r0rr+r,r-r.r/r1r2r3r4r5NzUPassing in an options dictionary to ConfigObj() is deprecated. Use **options instead.)�
stacklevelzUnrecognised option "%s".F)
�_inspecr�r��warnings�warn�DeprecationWarning�OPTION_DEFAULTSrnrPrr��_original_configspec�_load)rK�infile�optionsr0rr+r,r-r.r/r1r2r3r4r5r��_optionsr�rrU�
keyword_values&&&&&&&&&&&&&&&&     rr��ConfigObj.__init__�s7��������Q��-����2�� �*���/�=�"�L�-��"�L�,�
���M�;�&�(8�(�F�(�*<�
>���?��G���M�M�?�,��
�
<�
!����/�#�$?�%�$G�H�H�!�!%�_�%:�%:�%<� =���u���'�%*�G�E�N� (���
��M�)�%2�G�E�N�!>��%*�G�M�"�����!��\�*�
�$.�!��
�
�6�&rc�a�\V\4'd�Wn\PPV4'd:\
VR4;_uu_4pVP4;'g.pRRR4EMHVP'd\RVP,4hVP'd/\
VR4;_uu_4pVPR4RRR4.pM�\V\\34'd
\V4pM�\V\4'd[\V\4'dV3RloS!W4MVF
pW,W&K	V=VeVP#V4R#RVnR#\'VR\(4\(JdVP+4;'g.pM\-R4hX'd[VP/V4pVFCpV'dVR,R9dKRF"pVP1V4'gKWpnM	M	\4;QJdR	V4F'dKR
M	RM
!R	V44'gQ\7V44hVUu.uFqfP9R4NK	ppVP;V4VP 'd�RVP ^,P<,p\?VP 4^8�dR
V,p	\AV	4p
MVP ^,p
VP V
n!W
n"V
hV=Vf
RVnR#VP#V4R# +'giEL�;i +'giEL�;iuupi)�rbNzConfig file not found: "%s".�wr�c�<�VPF
pW,W&K	VPFp/W&S!W,W,4K	R#rGrE)�
in_section�this_sectionrr��set_sections&&  �rr��$ConfigObj._load.<locals>.set_section�sF���!+�!3�!3��.8�.?��+�"4�#-�#6�#6��02��-�#�J�$7��9N�O�$7r�readz>infile must be a filename, file like object, or list of lines.�
c3�B"�TFp\V\4x�K	R#5irG�ror)�.0r�s& r�	<genexpr>�"ConfigObj._load.<locals>.<genexpr>s���=�W�T�:�d�C�(�(�W�s�FTzat line %s.z2Parsing failed with several errors.
First error %s���)�
�
)r�r�r�)#ror�filename�os�path�isfile�open�	readlinesr/r�r.�writerPrar�r!�_errors�_handle_configspecr0rwr3r�rn�_handle_bom�endswith�newlines�allr^�rstrip�_parser�r�r�errors�config)rKr�r0�h�contentrr�r��infor��errorr�s&&&        @rr��ConfigObj._load�s�����f�c�"�"�"�M��w�w�~�~�f�%�%��&�$�'�'�1��k�k�m�1�1�r�G�(�'������<�t�}�}�L�M�M��$�$�$��f�c�*�*�a������+���
���u�
�
.�
.��6�l�G�
���
%�
%��&�)�,�,�P��F�)�$�E�"(�-�D�K�$����%��'�'�
�3�
�#'����
�V�V�W�
-�W�
<��k�k�m�)�)�r�G��\�]�]���&�&�w�/�G�
 ���$�r�(�,�">��/�C��}�}�S�)�)�(+�
��0�� ��s�=�W�=�s�s�s�=�W�=�=�=�L�t�G�}�L�=�3:�;�7�4�;�;�v�&�7��;����G���<�<�<� �4�<�<��?�#>�#>�>�D��4�<�<� �1�$�K�d�R��&�s�+�����Q��� �<�<�E�L��L��K��L���"�D�O��#�#�J�/�s(�'�'��+�*�*��p<s�M�M'�4M;�M$	�'M8	c��Vf\pRVn.VnVR,VnVR,VnVR,VnVR,VnVR,VnVR,VnVR,Vn	VR,Vn
VR	,VnR
VnRVn
VR,VnVR,Vn.Vn.VnRVnVP&'dR
Vn\(P+V4R#)
Nr,r+r-r.r/r1r2rr3Fr5r4)r�r�r�r,r+r-r.r/r1r2rr3�BOMr�r5r4�initial_comment�
final_commentr0r�r�r�)rKr�s&&rr��ConfigObj._initialise+s����?�%�G���
����#�N�3���$�_�5���"�=�1���#�N�3���!�,�/��� ��-���"�=�1����
�+��
� '�(:� ;��������
�")�*>�"?����h�'���!����������<�<�<�$�D��	���D�!rc
��a�V3RlpRRPSPSP,Uu.uF$p\V4:R\V!V44:2NK&	up4,#uupi)c�f<�SV,# \d\PST4u#i;irGrUrVs&�rrW�#ConfigObj.__repr__.<locals>._getvalLrYrZzConfigObj({%s})r[r\r]r_sf  rr`�ConfigObj.__repr__Ksb���	3�
"��	�	� �L�L�4�=�=�8�;�8�C�)-�S�	�4����3E�F�8�;�<�<�	=��;rbc��VPe?VPP4\9dVPWP4#\	V\
\34'dV^,pMTp\	V\4'dVPWP4#VPEe7\VPP4,pVR8Xdy\\P44F<wpwrVV'gKVPV4'gK+VPW4u#	VPWP4#\V,pVPV4'gVPWP4#V\V4Rp\	V\
\34'dWq^&MTpRVn
VPWP4#\\P44EFwpwrV\	V\4'dVPV4'gK8W`nV'g�RVn
V\V4Rp\	V\
\34'dWq^&MTp\	V\4'dVPR4u#\	V\4'd#VP!R4PR4u#VPVR4u#VPW4u#	\	V\4'd!VP!R4PR4#VPVR4#)a�
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.
Nr
Tr)rrr�_decoderorPrar�BOMSr�
startswith�BOM_SETr�r��bytes�
splitlines�decode)rKr�r��encr�r�final_encoding�newlines&&      rr��ConfigObj._handle_bomVs���.�]�]�
&�
�]�]�
 �
 �
"�(�
2��<�<��
�
�6�6��f�t�U�m�,�,��!�9�D��D��d�C� � ��<�<��
�
�6�6��=�=�$�
�4�=�=�.�.�0�1�C��h��7;�D�J�J�L�7I�3�C�3�(�)� ��(�(��-�-� $�|�|�F�=�=�8J��|�|�F�M�M�:�:��#�,�C��?�?�3�'�'��|�|�F�M�M�:�:��3�s�8�9�o�G��&�4��-�0�0�#�q�	� ���D�H��<�<��
�
�6�6�04�D�J�J�L�/A�+�C�+�(��d�E�*�*�$�/�/�#�2F�2F��!/�
�%�#�D�H�#�3�s�8�9�o�G�!�&�4��-�8�8�$+�q�	�!(��!�&�#�.�.�%�0�0��6�6�#�F�E�2�2�%�}�}�W�5�@�@��F�F�#�|�|�F�G�<�<��|�|�F�5�5�10B�8�f�e�$�$��=�=��)�4�4�T�:�:��<�<���0�0rc��\V\4'd.VP'dVPVP4#V#)z@Decode ASCII strings to unicode if a self.encoding is specified.)ror�rr�)rK�aStrings&&r�_a_to_u�ConfigObj._a_to_u�s/���g�u�%�%�$�-�-�-��>�>�$�-�-�0�0��Nrc��\V\4'dVPR4#\V\4'd:V'd!VP	V4PR4#VPR4#V'd@\V4F0wr4\V\4'gKVP	V4W&K2	V#)zn
Decode infile to unicode. Using the specified encoding.

if is a string, it also needs converting to a list.
T)rorr�r�r��	enumerate)rKr�rr\r�s&&&  rr��ConfigObj._decode�s����f�c�"�"��$�$�T�*�*��f�e�$�$���}�}�X�.�9�9�$�?�?��(�(��.�.��$�V�,����d�E�*�*�!%���H� 5�F�I�-��
rc��\V\4'd.VP'dVPVP4#V#)z'Decode element to unicode if necessary.)ror�r3r�)rKr�s&&r�_decode_element�ConfigObj._decode_element�s4���d�E�"�"�t�'<�'<�'<��;�;�t�4�4�5�5��Krc�H�\V\4'g\V4#V#)zP
Used by ``stringify`` within validate, to turn non-string values
into strings.
r��rKrUs&&r�_str�ConfigObj._str�s"��
�%��%�%��u�:���Lrc��	�VPpVP'dRVn.pRpTp\V4^,
pRpRpWv8EdJV'd.pV^,
pW,p	V	P4p
V
'dV
P	R4'dRpVPV	4KfV'gW0n.pRpRpVPPV	4pVEe[VP4wr�r�pV'dVPfW�n
V
PR4pVVPR48wdVPR\W4EKVVP8dVPVV4P pMSVVP8XdVP pM5VVP^,8XdTpMVPR	\W4EK�VP%V4pVV9dVPR
\&W4EK�\)VVVVR7pVVV&VVP*V&VVP,V&EK�VP.PV	4pVf*VPRP1V	4\2W4EK<VP4wpppV'dVPfW�n
VR
,R9d;VP5VWV4wpppVP'dRp\V4pM7M6VP'dRp\V4pMVPAV4wppVP%V4pVV9dVPR\&W4EKVPCVVRR7VVP*V&W5P,V&EKPVPfRVn
V'gVP'gW0nMV'gW0n"W nR# \"dTPR\Y4EK�i;i \6d>p\9T4\:8XdRpMRpTPT\<TT4Rp?EK	Rp?ii;i \"dTPR\2Y4EK7i;i \6d@p\?T\:4'dRpMRpTPT\<TT4Rp?EK�Rp?ii;i \"dTPR\2Y4EK�i;i)zActually parse the config file.F�#TN�[�]z Cannot compute the section depthzCannot compute nesting levelzSection too nestedzDuplicate section name)rhz=Invalid line ({0!r}) (matched as neither section nor keyword)�N�Nr�zUnknown name or type in valuez+Parse error from unrepr-ing multiline valuezParse error in multiline valuez!Parse error from unrepr-ing valuezParse error in valuezDuplicate keyword name)r4r�)r�r�)#r-r4r��stripr�r"r��_sectionmarkerr��groupsr2�count�
_handle_errorrr��_match_depthryr��_unquoterr�rr�_keyword�formatr�
_multilinerx�typer)r(ro�
_handle_valuer#r�)rKr��temp_list_values�comment_list�
done_startr��maxline�	cur_index�
reset_commentr��sline�mat�indent�	sect_open�	sect_name�
sect_close�comment�	cur_depthryr�rU�er�s&&                     rr��ConfigObj._parse�s����+�+���;�;�;�$�D�����
����f�+��/���	��
��!��!����N�I��$�D��J�J�L�E��E�,�,�S�1�1� %�
��#�#�D�)���'3�$�!��!�
� �M��%�%�+�+�D�1�C���FI�j�j�l�C��I�7��t�/�/�7�'-�$�%�O�O�C�0�	��
� 0� 0�� 5�5��&�&�'I�'3�V�H���|�1�1�1�!�!%�!2�!2�<�3<�">�>D�f���,�"4�"4�4�)�0�0�F��,�"4�"4�q�"8�8�)�F��&�&�';�'3�V�H�� �M�M�)�4�	���&��&�&�'?�'5�v�J�� '����"�	 $��
%1��y�!�4;��&�&�y�1�-9����	�*���-�-�%�%�d�+�C��{��"�"�S�Z�Z�[_�`���3�(+�z�z�|�$���e��t�/�/�7�'-�$���9��.�)�48�O�O�!�6�g�5?�1��w�	� �;�;�;�&(�G�	)�(.�u�
��'��{�{�{�"$��	%�$*�5�M�E�%�/3�/A�/A�%�/H�,�U�G��m�m�C�(���,�&��&�&�0�&��;���(�(��e�D�(�A�4;��,�,�S�1�-9�%�%�c�*�����#�!�D���D�0�0�0�#/� ��!-��+���e'�!��*�*�+I�+7��L� �!��x$-�)�#'��7�k�#9�*I�C�*W�C� $� 2� 2�3��V�$-�!/� (��)��'�!��*�*�<�&��;�!�	!��. )�%�)�!�[�9�9�&E��&I�� �.�.�s�K�� )�+�$��%�� +�%� �.�.� 6� *�F�?�%�	%�sf�O�=Q�)P�Q=�S
�"P�P�Q�1Q�Q�"Q:�9Q:�=S�3S�S�
"S1�0S1c��W!P8d(WPJd\4hVPpK7VPV8XdV#\4h)z�
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.
)r�ryr�)rK�sectr�s&&&rr�ConfigObj._match_depth�sB���j�j� ��{�{�"�!�m�#��;�;�D��:�:����K��m�rc��W4,pV^,
pRPW4pV!WdV4pVP'dVhVPPV4R#)z�
Handle an error according to the error settings.

Either raise the error or store it.
The error will have occured at ``cur_index``
z{0} at line {1}.N)r	r,r�r")rK�text�
ErrorClassr�rr�r�r�s&&&&&   rr�ConfigObj._handle_error�sV��� ���Q��	�$�+�+�D�<���7�t�4�������K�	
�����E�"rc�r�V'g\hV^,VR,8XdV^,R9dV^RpV#)z%Return an unquoted version of a valuer�)�"�')r�r�s&&rr�ConfigObj._unquote�s6������!�H��b�	�!��a��J�(>��!�B�K�E��rc
��V'dVP'd
VR8XdR#V'd�\V\\34'dnV'gR#\	V4^8Xd"VPV^,RR7R,#RP
VUu.uFpVPVRR7NK	up4#\V\4'g1VP'd
\V4pM\RV,4hV'gR#VP'*;'dRV9;'dR	V9pT;'d R
V9;'dRV9;'gRV9pT;'d/V'*;'d R
V9;'dRV9;'dR	V9pT;'gV'*;'dV'*pV'dwVP'g\pMnRV9d\RV,4hV^,\9d!VR
,\9dRV9d\pM#VPV4pMVPV4pV\8Xd+R	V9d$VP'dVPV4pW�,#uupi)a<
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.
r��,F��	multiliner[zValue "%s" is not a string.�""r�r�r&r%�#Value "%s" cannot be safely quoted.r�)r5rorPrar��_quoter�rr1rnr-�noquotr�wspace_plus�_get_single_quote�_get_triple_quote)	rKrUr+r��no_lists_no_quotes�need_triple�hash_triple_quote�check_for_single�quots	&&&      rr.�ConfigObj._quote�s!��&��0�0�0�U�b�[����E�D�%�=�9�9����U��q���{�{�5��8�u�{�=��C�C��9�9� �"� �C�#�k�k�#��k�?� �"�#�
#��%��%�%��~�~�~��E�
��� =�� E�F�F���!%�!1�!1�1�\�\�d�%�6G�\�\�C�W\�L\���]�]�s�e�|�&G�&G�#��,�%\�%\�T�UZ�]��%�r�r�k�/�r�r�s�e�|�r�r�RU�Y^�R^�r�r�eh�lq�eq��.�A�A�k�/�\�\�K\�G\����#�#�#������$�%J�U�%R�S�S���8�;�.��2�Y�k�1���%����-�-�e�4���)�)�%�0�D��6�>�c�U�l�t�/?�/?�/?��)�)�%�0�D��|���O"s�I=c�p�RV9dRV9d\RV,4hRV9d	\pV#\pV#)r&r%r-)r�squot�dquot�rKrUr7s&& rr1�ConfigObj._get_single_quotes?���5�L�s�e�|� �!F��!N�O�O�
�E�\��D����D��rc���VPR4R8wd)VPR4R8wd\RV,4hVPR4R8Xd	\pV#\pV#)r�r�r-r�)�findr�tdquot�tsquotr<s&& rr2�ConfigObj._get_triple_quote&s]���J�J�u���#�%�*�*�U�*;�r�*A� �!F��!N�O�O��:�:�e���"��D����D��rc��VP'dVR3#VP'g:VPPV4pVf\	4hVP4#VPPV4pVf\	4hVP4wr4rVVR8XdVf\	4hVe.V3#Ve1V'dV'gRpMT;'gRpVPV4pVR8XdWF3#VPPV4pVUu.uFq�PV4NK	ppVe
Wt.,
pWv3#uupi)zh
Given a value string, unquote, remove comment,
handle lists. (including empty and single member lists)
r�Nr,)
r�r-�_nolistvaluer�r�r�	_valueexpr�
_listvalueexp�findall)	rKrUrr-�single�
empty_listrror�s	&&       rr�ConfigObj._handle_value0s6��
�<�<�<��2�;�������#�#�)�)�%�0�C��{�!�m�#��:�:�<���n�n�"�"�5�)���;��-��58�Z�Z�\�2��j��2��F�N��-���!���=� ����6������4�����v�.���"���$�$��%�%�-�-�k�:��2:�;�(�3�M�M�#�&�(��;����� �H��"�"��<s�Ec�\�VR,pVR,pVPV,^,pVPV,^,pVPV4p	V	e-\V	P44p
V
P	V4V
#VPV4R8wd\
4hW48d<V^,
pVR,
pW#,pVPV4R8XdWk,
pK@M
\
4hVPV4p	V	f\
4hV	P4wrWa,W�3#)z9Extract the value, where we are in a multiline situation.r�:rNNr�r�)�
_triple_quoter�rPrr"r?r�)
rKrUr�rrr7�newvalue�single_line�
multi_liner�retvalr�rs
&&&&&        rr
�ConfigObj._multilineas���R�y����9���(�(��.�q�1���'�'��-�a�0�
�����&���?��#�*�*�,�'�F��M�M�)�$��M�
�]�]�4�
 �B�
&��-���!���N�I����H��$�D��y�y���"�$�� ����-�����t�$���;��-���:�:�<���� �'�5�5rc���\V\4'g\VRRRR7pWnR# \dp\RT,4hRp?i\dp\	RT,4hRp?ii;i)zParse the configspec.T)r,r/r�zParsing configspec failed: %sNzReading configspec failed: %s)ror!rr r�r0)rKr0rs&& rr��ConfigObj._handle_configspec�su���*�i�0�0�

C�&�z�48�26�/3�5�
�%���"�
K�&�&E��&I�J�J���
C��=��A�B�B��
C�s&�/�A1�A�A1�A1�A,�,A1c�8�VPpVPR4p\V\4'd)VPFpWS9gKWAV,nK	VPF�pVR8XdKWQ9dl/W&RW,nV'dSVPPV.4VPV&VPPVR4VPV&\W,\4'gK�W5,W,nK�	R#)zr
Called by validate. Handles setting the configspec on subsections
including sections to be validated by __many__
�__many__Tr�N)	r0rror�rrrrr�)rKr��copyr0�manyrs&&&   r�_set_configspec�ConfigObj._set_configspec�s���
�'�'�
��~�~�j�)���d�D�!�!� �)�)���*�04�E�N�-�*� �(�(�E��
�"���#�!#���*.���'��.8�.A�.A�.E�.E�e�R�.P�G�$�$�U�+�5?�5O�5O�5S�5S�TY�[]�5^�G�+�+�E�2��'�.�'�2�2�,6�,=���)�)rc��VP'g"VPVPV44pM\V4pV:VPVPVRR74:VP	R4:V:VPV4:2#)z.Write an individual line, for the write methodFr*z = )r4r�r.r^r�)rK�
indent_stringrrerr�s&&&&& r�_write_line�ConfigObj._write_line�sv���{�{�{��&�&�t�{�{�:�'>�?�C��z�"�C�,�#�3�3�D�K�K��QV�K�4W�X�#�|�|�E�2�"�#�3�3�G�<�	>�	>rc���V:VPRV,4:VPVPV4RR7:VPRV,4:VPV4:2#)zWrite a section marker liner�Fr*r�)r�r.r�)rKr[r�rrs&&&&&r�
_write_marker�ConfigObj._write_marker�sY��,�#�|�|�C�%�K�8�#�{�{�4�+?�+?��+F�RW�{�X�#�|�|�C�%�K�8�#�3�3�G�<�	>�	>rc��V'gR#VPpVPR4'gW PR4,
pW!,#)zDeal with a comment.r�r�z # )r2r�r�)rKrr�s&& r�_handle_comment�ConfigObj._handle_comment�s=����� � ���!�!�#�&�&��\�\�%�(�(�E��� rc	�r
�VPf\Vn.pVPR4pVPR4pVf�VPpRVnTpVPF\pVPV4pVP
4pV'd VPV4'g	WW,pVPV4K^	VPVP,p	VPVP,EFAp
W�P9dKVPV
,F`pVPVP44pV'd VPV4'g	W[,pVPW�,4Kb	W*,pVPVP V
,4p
\#V\$4'dRVPVP'V	VPV
V
44VP)VP+VR74EKVPVP-V	V
VV
44EKD	W JdtVP.F\pVPV4pVP
4pV'd VPV4'g	WW,pVPV4K^	XVnW JdV#VP0f�Vf�VP2'd*VUu.uFq�P5VP24NK	ppVP6'dqVP2e3\8P;VP2P=44R8Xd1V'gVPR4\>V^,,V^&V#VP@;'g\BPDp\GVRR4e0VPHR	8Xd\JPLR
8Xd
VR8XdRpVPV4POV4pVPQV4'g
VV,
p\#V\R4'dTpM9TP5VP2;'gVPT;'gR
4pVP6'd7VP2e\WVP24'd\>V,pVeVP+V4R#\YVP0R4;_uu_4pVP+V4RRR4R#uupi +'giR#;i)a
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')
Nr�z# Fr�rr��moder��win32r�r��ascii�wb)-r2�DEFAULT_INDENT_TYPEr�r+r�r�rr�r"r�rrr	r�lstriprbrror�r_�extendr�r\r�r�r�encoder�rrrrr�r��lineseprwre�sys�platformr�r�r�r3rr�)rK�outfiler�r|�cs�csp�int_valr��
stripped_liner[r�comment_linerer�lr��output�output_bytesr�s&&&                rr��ConfigObj.write�s�����#�2�D����
�\�\�#�
���l�l�4� ���?��(�(�G�!&�D���G��,�,���+�+�D�1�� $�
�
��
� ��)A�)A�"�)E�)E��:�D��
�
�4� �-��(�(�7�=�=�8�
��o�o��(8�(8�8�8�E��(�(�(�� '� 0� 0�� 7� 7��#�3�3�L�4G�4G�4I�J����(?�(?��(C�(C�#&�#5�L��
�
�=�7�8�	!8�
!��J��*�*�7�+B�+B�5�+I�J�G��*�g�.�.��
�
�4�-�-�!��$�$���	��
�
�
�4�:�:�j�:�9�:��
�
�4�+�+�!����	��+9�6�?��*�*���+�+�D�1�� $�
�
��
� ��)A�)A�"�)E�)E��:�D��
�
�4� �+�")�D�����J��M�M�!����}�}�}�8;�<��1�x�x��
�
�.���<�����t�}�}�4����d�m�m�1�1�3�4��?���J�J�r�N�!�C��F�*��A���J��-�-�-�-�2�:�:���G�V�T�*�6�7�<�<�3�;N�����'�G�v�,=��G����g�&�+�+�C�0�����w�'�'��g��F��f�e�$�$�!�L�!�=�=����*1�*1�)-�)>�)>�*1�*1�)0�2�L��8�8�8�$�-�-�/�J�t�}�}�4M�4M�#�l�2�L����M�M�,�'��d�m�m�T�*�*�a�����%�+�*��C=�B+�*�*�s�*#T �T%�%T6	c	�	aaaaaaa�Sf�SPf\R4hS'd^RIHpVSnSoS'd�SPP
SnSPPSnSPPSnSPPSnSPPSn	SPPSn
SPoSPSS4VVVVVVV3Rlp/oRpRpSPU	u.uF
q�S9gKV	NK	p
p	SPU	u.uFq�SP9gKV	NK	pp	SPU	u.uFq�SP9gKV	NK	pp	SPF�p
V
R9dKV
SP9dV
SP9dqRpRpS'ddV
SP9dSSPP!V
.4SPV
&SP"P!V
R4SP"V
&MR	pSV
,pV!V
SV
,VW�V4wrxK�	RpRSP9dSR,pMRSP9d
SR,pVe#V
Fp
SV
,pV!V
VVR	Wx4wrxK	.p
VF3p
R	pS'gR	SV
&KR	pR
V
,pSP%V4SV
&K5	VF3p
R	pS'gR	SV
&KR	pRV
,pSP%V4SV
&K5	SPF�p
SSJd
V
R8XdKSV
,PfV
P'V
4K:S'dSSPP!V
.4SPV
&SP"P!V
R4SP"V
&SP)SSSSV
,R
7pVSV
&VR	8XdR	pK�VR8XdR	pK�R	pK�	V
SnS'dSP,'gR	pV'd/S'd'S'd\/SP144'*pV'dR#V'dR	#S#uup	iuup	iuup	i)a3
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.
NzNo configspec supplied.)�VdtMissingValuec�l<�S
PPVR4SPS	V,4S
PV&SP
VVVR7pRpRSV&SP'g	V'd�SP'g^\V\\34'd"VUu.uFpSPV4NK	ppM V'dVfRpMSPV4pWb8wg	V'dVS
V&S
'g5V'd-VS
P9dS
PPV4WE3# \\SP
3dELi;iuupi SP
d@pS'd\TSP4'dRST&MTST&RpRpRp?YE3#Rp?ii;i)N)�missingFTr�)r
r4�get_default_valuer,r�baseErrorClass�checkr1rorPrar�r	r"�_vdtMissingValue)r�specr�r}�ret_true�	ret_falser��itemrr0rVr|�preserve_errorsr�rK�	validators&&&&&&   �������r�validate_entry�*ConfigObj.validate.<locals>.validate_entry�s�����"�"�&�&�u�d�3�
�09�0K�0K�J�W\�L]�0^��&�&�u�-�
3�!����(+�07�(�*��"�	�!��E�
��>�>�>�W� �>�>�>�%�e�d�E�]�;�;�AF�$G���T�Y�Y�t�_��E�$G�E�$���$&�E�$(�I�I�e�$4�E����).������E��9I�9I�,I��$�$�+�+�E�2��&�&��K�n�i�.F�.F�G�
��
��6%H��#�+�+�
!�&�*�Q��8M�8M�*N�*N�!&�C��J�"#�C��J� %�I� ��(�&�&��7
!�s/�%D;�E#�,E�;E�E�#F3�43F.�.F3TrU�
___many___r�Fz"Value %r was provided as a sectionz)Section %r was provided as a single valuer�)r�rVr�)rUr�)r0r �configobj.validater{r�r�r�rr�r�r2rXrrr	rrrrr"�validaterr�anyrB)rKr�r�rVr�r{r�r�r�r��unvalidated�incorrect_sections�incorrect_scalarsrr}r�rWr�r�r0r|sfffff              @@rr��ConfigObj.validateJsF���H�?����&� �!:�;�;��?�(7��%��G��*1�*<�*<�*L�*L��'�(/�(:�(:�(H�(H��%�#*�#5�#5�#>�#>�� �%�0�0�4�4���#*�#5�#5�#>�#>�� �&-�&8�&8�&D�&D��#��'�'�
����W�d�+�*	'�*	'�Z�����	�")�/�/�I�/�Q�j�5H�q�q�/��I�)3�)<�)<�U�)<�A�W�_�_�@T�a�a�)<��U�(2�(:�(:�T�(:�1�7�CS�CS�>S�Q�Q�(:��T��'�'�E��2�2���W�_�_�,�%�7�;K�;K�2K������E����8�#�+�+�/�/��r�:��$�$�U�+�#�2�2�6�6�u�b�A��+�+�E�2�� ���e�n��"0��
�5�8I�3�18�I�#O��H�i�)(�.����+�+�+��j�)�D�
�Z�/�/�
/��l�+�D���$���e�n��&4�U�D�#�u�5=�'J�#��)�%��K�&�E��H�"�"��E�
�!�	�:�U�B��&�5�5�c�:��E�
�'�(�E��H�"�"��E�
�!�	�A�E�I��&�5�5�c�:��E�
�(��%�%�E��$��5�I�#5���u�~�(�(�0��"�"�5�)���*4�*=�*=�*A�*A�%��*L�� � ��'�1;�1K�1K�1O�1O�PU�WY�1Z��'�'��.��M�M�)�_�SW�ah�in�ao�M�p�E��C��J���~� ���$��!�	� ��#&�& +����7�#3�#3�#3��I���S�
 ��
�
��-�-�I���
���
��}J��U��Ts$�$Q<�1Q<�R�R�4R�Rc�b�VP4VP4RVnRVnR#)z@Clear ConfigObj instance and restore to 'freshly created' state.N)r;r�r0r�r�s&r�reset�ConfigObj.reset	s(���
�
���������$(��!rc�@�\VP\4'g\4hVPp/p\FpVR8XdK\W4W#&K	VPpWBR&VP4VPV4VPW4R#)z�
Reload a ConfigObj from file.

This method raises a ``ReloadError`` if the ConfigObj doesn't have
a filename attribute pointing to a file.
r0N)
ror�rr'r�rwr�r;r�r�)rKr��current_optionsrr0s&    r�reload�ConfigObj.reload$	s����$�-�-��-�-��-���=�=����$�E���$��%,�T�%9�O�"�%�
�.�.�
�(2��%��
�
������)��
�
�8�(r)r�r�r�r�r�r0r.r3rr/r�r�r2r�r+r-r�r,r1r4r5)NNNNTFTFFTNNFFFrG)Tr�)FFN)0r?r@rArBr�r�r�r�rrrErFrD�_single_line_single�_single_line_double�_multi_line_single�_multi_line_doublerLrr�r�r�r`r�r�r�r�r�r�rrrr.r1r2rr
r�rXr\r_rbr�r�r�r�rCr�r�s@rr!r!*s�����<��z�z�
�	�
�
��H��Z�Z�
!
�	�
�
��N�"�
�
�
�0	�
�
�1�I�6�J�J� �	�
�
��M��:�:�
�	�
�
�	�L��*�*�%>�?���*�*�%>�?�����$:�;�����$:�;��	�#�%7�8�
�#�%7�8��M�	�t�T�5��d�E�5��T�3����g�u�	
�F�7'�t]0�@"�@=�n1�b��2�
�d,�N�&#�&�D�N��.#�b 6�F%�*>�8>�>�!�p&�dL�^)�)�)rc�4a�]tRtRtoRtRtRRltRtVtR#)r"i>	a�
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``)
c��\VnR#rG)rrr�s&rr��SimpleVal.__init__J	s
��,��rc�6�V'dVP4hV#)z9A dummy check method, always returns the value unchanged.�r)rKr��memberr}s&&&&rr��SimpleVal.checkM	s����%�%�'�'��
rr�Nr�)	r?r@rArBr�r�r�rCr�r�s@rr"r">	s����	�-��rc�R�Vf.p.pVR8Xd\V4#VR8Xg\V\4'd?VPVR,RV34V'dVP	4\V4#\VP
44FswrEVR8XdK\VPV4\4'd'VPV4\W,WRV4KYVPVR,WE34Ku	V'dVP	4\V4#)ao
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*.
NTF:NNN)
�sortedrorxr"r4rPrrr��flatten_errors)�cfg�res�levels�resultsr�r�s&&&&  rr�r�T	s���@�~�����
�d�{��g���
�e�|�z�#�y�1�1�����q�	�4��-�.���J�J�L��g����3�9�9�;�'�
���$�;���c�g�g�c�l�D�)�)��M�M�#���3�8�S�'�:������q�	�3�,�-�(���
�
���'�?�rc��.pTPVPUu.uFq1V3NK	up4VPF=pW0P9gKVP\W,W3,44K?	V#uupi)a�
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.
)rkrr�get_extra_values)�conf�_prependr|rhs&&  rr�r��	sq��"
�C��J�J�T�->�->�?�->�T�4� �->�?�@��
�
���(�(�(��J�J�'��
�H�w�4F�G�H���J��	@s�A>)rN)r	r
)rr
)r
r
)rirrrrrr r!r"r#r$r%r&r'r(r)r�r�r�)r>):r�r�rn�codecsrrrr�_versionrr7r�rr�rr:r;r/r0rAr@�objectr3�__all__rri�MAX_INTERPOL_DEPTHr�r<rxr)rE�_builderr4r�rrrr�r'rr r#r$r&r%r(r�r�r�rr�r�r�r!r"r�r�r>rr�<module>r�sz�� 
�	�
�B�B�!���
�o��(��(�
�#�	��
�h�	�8��X��h��
����
��
����
��W��'�	�7�
�G��W���(�X��i������(���5�
	����	
����	��	���(����*'�������T��E��4��E��%��$����4������e��%��� @�	�)�	�44�f�44�n�9���,�[�,��>�����F�'�F��^���n��7��7�C�/�C����/�!3�/�+�.�+�
x$�&�x$�x#� 3�#�)�/�)�6�-��%���#�b	-�d�b	-�JP)��P)�h(���,9�x�4Hr

Youez - 2016 - github.com/yon3zu
LinuXploit