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/xkit/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/xkit/__pycache__/xorgparser.cpython-314.pyc
+
p��O�W���^RIHt^RIHt^RIt^RIHtHt^RIt!RR]4t!RR]4t	!R	R
]4t
!RR]4t!R
R]4t
R#)�)�print_function)�unicode_literalsN)�stdout�stderrc��]tRt^tRtRtR#)�IdentifierExceptionz#Raise if no identifier can be found�N��__name__�
__module__�__qualname__�__firstlineno__�__doc__�__static_attributes__r	��1/usr/lib/python3/dist-packages/xkit/xorgparser.pyrrs��-�rrc��]tRt^tRtRtR#)�OptionExceptionz&Raise when an option is not available.r	Nr
r	rrrr���0�rrc��]tRt^"tRtRtR#)�SectionExceptionz&Raise when a section is not available.r	Nr
r	rrrr"rrrc��]tRt^&tRtRtR#)�ParseExceptionz&Raise when a postion is not available.r	Nr
r	rrrr&rrrc�a�]tRt^*toRtR0RltRtRt]!]]4t	Rt
RtRtR	t
R
tRtR0RltR
tR1RltR2RltR2RltR0RltR3RltR0RltR0RltR0RltR0RltR0RltR3RltR0RltR0RltRtR3Rlt R2Rlt!R3Rlt"Rt#R t$R!t%R"t&R0R#lt'R$t(R%t)R&t*R't+R(t,R)t-R3R*lt.R+t/R2R,lt0R0R-lt1R.t2R/t3Vt4R#)4�ParserzVOnly low-level methods here.

See the xutils.XUtils subclass for higher-level methods.Nc���RVnRVnWnRRRRRRR	R
RRR
RRRVPVP3VnVPRRVn.ROVn.ROVn/PVP
4Vn.Vn	/PVP^4Vn
VPFp/VPV&K	VP4R#)asource = can be an object or a file. If set to None (default)
         Parser will start from scratch with an empty
         configuration.

Public:

comments = name of the section which stores the commented lines
           located outside of the sections in the xorg.conf.

globaldict = a global dictionary containing all the sections and
             options. For further information on globaldict, have a
             look at __check_sanity() and at get_value().

globaldict['Comments'] = stores the commented lines located inside of
                         the sections in the xorg.conf.

require_id = a list of the sections which require to have an
            "Identifier" set in the xorg.conf (e.g. Device sections).

identifiers = a dictionary of the sections which require identifiers.

sections = a tuple containing the names of all the sections in
           globaldict. Their names are not guaranteed to be all legal
           in xorg.conf (see "valid_sections").

valid_sections = a tuple containing the names of all the sections
                 which __check_sanity() will look for in the
                 xorg.conf. Sections with other names will be ignored
                 by self._check_sanity().

references = a list containing the names of all the possible
             references.�
SubSection�Comments�InputDevice�Device�Module�Monitor�Screen�ServerLayout�ServerFlags�
Extensions�Files�
InputClass�DRI�VideoAdaptor�Vendor�ModesN���)r(rr r"r#r$)r rr"r#)�
subsection�commentsection�source�sections�valid_sections�
require_id�
references�fromkeys�identifiers�comments�_gdict�
_check_sanity)�selfr0�elems&& r�__init__�Parser.__init__.s���D'���(�����&�!�!�"�!�'�&�%� �%��'�!� �����,�,�.��
�"#�m�m�C�R�0����������;�;�t���7�����
��k�k�$�-�-��3����K�K�D� "�D�K�K��� �	
���rc��VP#�N�r8)r:s&r�_get_global�Parser._get_global~s���{�{�rc��WnR#r?r@)r:�global_dicts&&r�_set_global�Parser._set_global�s��!�rc��VPpVR8Xd.pMO\VR4'g.\VR4pVP4pVP	4MVP4p/PVP^4pRpRpRpRp^p	^p
^pVEF2pVP4PR4'Ed=VR8XdVPPV4EM�WH,p
VR8Xd�VPVP,PV/4VPVP,V,pVPV
/4W�,PRR4W�,PR	V
4W�,PR
R4W�,PR.4W�,R,PVP44EMW@P,pVPVP,PVP/4VPVP,VP,pVPV/4W�,PRX4W�,PR	V
4W�,PR
V4W�,PR.4W�,R,PVP44?EM�VP4P4PR
4'd�RpVP FIpVP4P#RVP4,R,4R8wgKERpTpM	V'gR
V,p\%V4hVR8XdV	^,
p	XpRpRpEMRp\%V4hVP4P4PR4R8Xd?V	^,
p	VR8Xd"VR8XdWH;;,^,
uu&RpRpEM�Rp\%V4hVP4P4PR4R8Xd�V
^,
p
VR8Xd�VR8Xd�RpW�P#R4^,VP'R4P4pVPPVP/4W@P,p/VPVP,V&VPVP,V,pW�R
&WH,VR	&TTR&.TR&?EMiRp\%V4hVP4P4PR4R8Xd?V
^,
p
VR8Xd"RpW@P;;,^,
uu&M�Rp\%V4hVR8wd�VP4R8wd�VR8XdXVPVP,X,R,PRVP4,R,4MrVPPV/4WH,pVPV,PV.4PRVP4,R,4V^,
pEK5	V'gLV	^,^8wgV
^,^8wdRp\%V4hVP+4VP-4R#VP+4R# \(d?Rp\%T4hi;i)a�Perform a sanity check of the file and fill self.globaldict with
all the sections and subsections in the xorg.conf


empty = is the file empty? If yes, then don't check if:
    * the last section is not complete
    * there are duplicates

has_section:
    * == True: a section is already open
    * == False: a section is closed and/or a new section can be opened
    
has_subsection:
    * == True: a subsection is already open
    * == False: a section is closed and/or a new section can be opened
    
section_flag:
    * == '':a section is closed and/or a new section can be opened
    * == the name the current section

section_tags = counter of the number of Section and EndSection strings

subsection_tags = counter of the number of SubSection and EndSubSection
                 strings

lines_list = the list of the lines in the source object.

global_iters = counts how many times each kind of section
                     (section_flag) is found in the xorg.confN�write�rTF��#�
identifier�position�section�options�"z;The name in the following line is invalid for a section:
%sz,Sections cannot be nested in other sections.�
endsectionz$An EndSection is in the wrong place.r.z7SubSections can be nested only in well formed sections.�
endsubsectionz=SubSections can be closed only after being previously opened.�	�
zThe last section is incomplete.r-)r0�hasattr�open�	readlines�closer5r1�strip�
startswithr7�appendr8r/�
setdefaultr.�lowerr2�findr�rfind�KeyError�_fill_identifiers�
_check_syntax)r:�file�
lines_list�myfile�global_iters�empty�has_section�has_subsection�section_flag�section_tags�subsection_tags�it�line�section_pos�	temp_dict�	curlength�
subsection_id�test_line_found�sectrN�errors&                    rr9�Parser._check_sanity�s	��B�{�{���4�<��J��4��)�)��d�C���#�-�-�/�
�����!�^�^�-�
��{�{�4�=�=�!�4��������������
���D��z�z�|�&�&�s�+�+��%�'��M�M�(�(��.�".�"<�K�%��.����D�$7�$7�8�C�C�L�RT�U�$(�K�K��0C�0C�$D�\�$R�	�!�,�,�[�"�=�!�.�9�9�,��M�!�.�9�9�*�k�R�!�.�9�9�)�T�J�!�.�9�9�)�R�H�!�.�y�9�@�@�����N�$0���$A�	����D�$7�$7�8�C�C�D�O�O�UW�X�$(�K�K��0C�0C�$D�T�_�_�$U�	�!�,�,�Y��;�!�,�7�7��m�T�!�,�7�7�
�K�P�!�,�7�7�	�<�P�!�,�7�7�	�2�F�!�,�Y�7�>�>�t�z�z�|�L�!�
����#�#�%�0�0��;�;�"'�� �/�/�D��z�z�|�(�(��t�z�z�|�);�c�)A�B�b�H�*.��"&���	0�
'�,�/3�5�E�(��/�/�"�e�+�$��)��'.�� %��&*�� N��,�U�3�3�����#�#�%�0�0��>�$�F���!���$�&�>�U�+B� �.�!�3�.�#%�L�"'�K�B�E�(��/�/�����#�#�%�0�0��>�$�F��1�$���$�&�>�U�+B�%)�N�$(���3��!�);�)-���C��%:�:?�%�'�"��K�K�*�*�4�?�?�B�?� ,�_�_� =�I�>@�D�K�K����0��;�!%���D�O�O� <�Y� G�I�+7�i�(�4�0<�0J�	�*�-�/<�I�l�+�+-�I�i�(�!�)�E�(��/�/�����#�#�%�0�0��A�T�I��1�$��!�T�)�%*�N� ���1�Q�6�1�2�E�(��/�/��2�%��z�z�|�r�)�)�T�1�!�K�K����8��C�!*�,�,2�F�4�$�*�*�,�3F��3M�,N� �K�K�2�2�<��D�(4�(B�I� �K�K��5�@�@��(*�,�,2�F�4�$�*�*�,�3F��3M�,N��!�G�B�M�P��a��1�$��!�(;�q�(@�9��$�U�+�+�
�"�"�$�
��� �
�"�"�$��}$�4�%�"4��,�U�3�3�	4�s�:\.�.]c���\VP44^8�d,R\VP44,p\V4hVP	4VP4p^pVFpV\W$,4,
pK	V^8�dR\V4,p\V4hVPFKp\VPV,4\VPV,48wgK@Rp\V4h	\VPR,4^8�dTVPR,F<pVPRVR.R7p\VR,4^8XgK1Rp\V4h	VP4p\V4^8�dM\V4^8�dRp\V4hVPRV^,R	7'gR
p\V4hR#R#)zmThis method contains the several checks which can guarantee
compliance with the syntax rules of the xorg.confz&There cannot be Duplicate Sections:
%sz%There cannot be Broken References:
%szDNot all the sections which require an identifier have an identifier.r$r#)�reflistzNThe ServerLayout section must have at least 1 reference to a "Screen" section.zRNo more than one default ServerLayout can be specified in the ServerFlags section.�rM�(The default ServerLayout does not exist.N)�len�get_duplicate_sections�strr�_validate_options�get_broken_referencesr3r8r6�get_references�get_default_serverlayout�
is_section)r:ru�brokenrmrN�screen_references�default_layouts&      rrb�Parser._check_syntax]s���>�t�*�*�,�-��1�>��D�7�7�9�:�<�E� ��'�'�
	
��� �&�+�+�-��
���G��#�f�o�&�&�B��
��6�<��F��L�E� ��'�'����G��4�;�;�w�'�(�C��0@�0@��0I�,J�J�/��$�U�+�+�	'��t�{�{�>�*�+�a�/��;�;�~�6�6��$(�$7�$7��8?�AI�
�%8�%L�!��(��2�3�q�8�H�E�(��/�/�7��6�6�8���~���"��>�"�Q�&�A��$�U�+�+��?�?�>�N�1�<M�?�N�N�B��$�U�+�+�O�
#rc��VPF�p.VPV&^pVPV,F^pVPVRV4pTPR4T^,pTPT,PYB34T^,
pK`	K�	R# \\
3dRY3,p\
T4hi;i \dLmi;i)a;Fill self.identifiers

self.identifiers has the section types as keys and a list of tuples
as values. The tuples contain the identifier and the position of
each section.

Here's a basic scheme:

self.identifiers = {section_type1: [
                                (identifier1, position1),
                                (identifier2, position2)
                              ], etc.
                   }

Concrete example:

self.identifiers = {'Device': [
                                ('Configured Video Device', 0),
                                ('Another Video Device', 1)
                              ],
                    'Screen': [
                                ('Configured Screen Device', 0),
                                ('Another Screen Device', 1)
                              ],
                   } �
Identifierz8No Identifier for section %s, position %d, can be found.rJN)	r3r6r8�	get_valuerrrr[�AttributeError)r:rtrmr;rLrus&     rra�Parser._fill_identifiers�s���6�O�O�D�%'�D���T�"��B����D�)�)��0�!%����l�B�!G�J���%�%�b�)�!+�A��J�� � ��&�-�-�z�.>�?��a���*�$��(�)9�:�0�-�04�|�<�E�(��/�/�	0��&����s�B�C�'C�C�Cc���RR.pR.pVPEFUpW19gKVPV,EF1pW0P8Xd#VPV,V,R,pMVPV,V,pVF�pVP4pVP	R4R
8wdV^VP	R4pRVP4,pVPVRR7p\
V4^8Xd6V^,P4P4V9d\V4hV^,^,P4'dK�\V4h	EK4	EKX	R	#)z�One word entries are not acceptable as either options or references

If a one word entry is found, ParseException will be raised.r'r�endmoderOrKz#The following option is invalid: %sT)�include_nullNr-)
r1r8r.rYr^�_clean_duplicatesr{r]r�isalpha)	r:�sections_whitelist�options_whitelistrNrMrO�optionru�optbitss	&        rr~�Parser._validate_options�s?��&�z�2��&�K���}�}�G��0� $���G� 4� 4�H��/�/�1�"&�+�+�g�"6�x�"@��"K��"&�+�+�g�"6�x�"@��#*��!'�����!�;�;�s�+�r�1�%+�A�v�{�{�3�/?�%@�F�!F�$*�L�L�N�"4��#'�"8�"8��FJ�#9�#L�� ��L�A�-�#�A�J�,�,�.�4�4�6�,�-�"0��"7�7�&�q�z�!�}�4�4�6�6�"0��"7�7�##*�!5�%rc��.ROp.p.pVR8Xd#VPV,V,R,pMVPV,V,pVF�pVP4pVPR4R8wdV^VPR4pVPV4pV^,P	4V9dVPV^,4K�V^,P	4R8Xd>\
V4^8�d,V^,R8wdVPV^,4K�K�K�K�	/p	VF0pV	PV4R8wdVPV4K,WyV&K2	V# \\3dEK1i;i)z�See if there are duplicate options in a section

It is ok to have duplicated references e.g. several Load options, or
Screen, etc. thoughrrOrKr�N)�driver�busidrLr-)
r8rYr^r�r]r[r{r��
IndexError�get)
r:rNrM�	blacklist�total�
duplicatesrOr�r��finals
&&&       r�get_duplicate_options�Parser.get_duplicate_optionssc��6�	����
��l�"��k�k�'�*�8�4�Y�?�G��k�k�'�*�8�4�G��F��\�\�^�F��{�{�3��2�%���6�;�;�s�#3�4���,�,�V�4�G�
��1�:�#�#�%��2��L�L����,��Q�Z�%�%�'�8�3��7�|�a�'�G�A�J�$�,>�����W�Q�Z�0�-?�'�4��0���F��y�y�� �D�(��!�!�&�)� &�f�
�	�
���#�J�/�
��
�s�4E*�AE*�*F�?Fc���/pVPFbpVPV,FHpVPW#4p\V4^8�gK&VPV/4PVV4KJ	Kd	V#)z5Look for and return duplicate options in all sections)r8r�r{r\)r:r�rNr;�duplopts&    r�check_duplicate_options�Parser.check_duplicate_optionsMsr���
��{�{�G����G�,�,���4�4�W�C���w�<�!�#��)�)�'�2�6�A�A�$�BI�K�-�#��rc�N�.pRp^p^pVPR4pV^8�d�VF�pVP4'gVR8XdV^,
pMCWH,
pM:V^,^8wd
WH,
pM#\V4^8�dVPV4RpV\V4^,
8XdVR8wdVPV4V^,
pK�	M�VF�pVP4'g
WH,
pM#\V4^8�dVPV4RpV\V4^,
8Xd5VR8wdVPV4MV'dRpVPV4V^,
pK�	V'd2\V4V^,^,8wdRpVPV4V#)z�Clean the option and return all its components in a list

include_null - is used only by _validate_options() and makes
sure that options with a null value assigned in quotation
marks are not considered as one-word optionsrJrP)�count�isspacer{r[)	r:r�r�r��optbitrm�	quotation�optcount�is	&&&      rr��Parser._clean_duplicatesZsd������
���	��<�<��$���a�<����y�y�{�{��C�x�!�Q��	����!�1�}��)�����v�;��?�#�N�N�6�2�%'�F���V��q��(���|����v�.��a���-�0���y�y�{�{��K�F��6�{�Q�����v�.�!#����V��q��(���|����v�.�(�%'�F�#�N�N�6�2��a���%�(�C��L�H�Q�J��M�9��F��N�N�6�"��rc�<�/pVPF�p.pVPV,FpVPV^,4K	VFLpVPV4^8�gKVPV/4PVVPV44KN	K�	V#)zhReturn a dictionary with the duplicate sections i.e. sections
of the same kind, with the same identifier)r6r[r�r\)r:r�rN�temprtr;s&     rr|�Parser.get_duplicate_sections�s����
��'�'�G��D��(�(��1�1�����D��G�$�2����:�:�d�#�a�'��)�)�'�2�6�A�A�$�7;�z�z�$�7G�I��	(��rc�,�R.pVR8wd_VPV,PV4R8Xd\hV'dVPWVVR7M%VPWVR7MVPW4VR8Xd�VR8Xd7RV,R,V,\	V4,V,R,p	M�VP4P
4V9d7RV,R,V,\	V4,V,R,p	MyRV,R,\	V4,R,p	MQRV,R,R,V,R,R,V,\	V4,V,R,p	\VPV,4^8Xdo/VPV&.VPV,^&WP9d:RV,R	,p
VPV,^,PV
4VR8XdFVPV,F,pVPV,V,PV	4K.	R#VPV,V,PV	4R#)
anAdd an option to a section

section= the section which will have the option added
option= the option to add
value= the value which will be assigned to the option
position= e.g. 0 (i.e. the first element in the list of Screen
              sections)
option_type= if set to "Option" it will cause the option to look like
            the following:
            Option "NameOfTheOption" "Value"
            
            Otherwise it will look like the following:
            NameOfTheOption "Value"
position= e.g. 0 (i.e. the first element in the list of Screen
              sections)
reference= used only in a particular case of reference (see
           add_reference)

prefix= usually quotation marks are used for the values (e.g. "True")
        however sometimes they don't have to be used
        (e.g. DefaultDepth 24) and prefix should be set to '' instead
        of '"'  �deviceN��valuerMryrSrTrPz	Identifier	"Default z"
)
r8r�r�
remove_optionr}rYr]r{r3r[)r:rNr�r��option_typerM�	reference�prefix�refSections�toaddrLr;s&&&&&&&&    r�
add_option�Parser.add_option�s"��0 �j���t���{�{�7�#�'�'��1�T�9�&�&���"�"�7�%�+3�#�5��"�"�7�X�"�F�
���w�/��$���D� �����-��6��U��C�f�L�� ���=�=�?�(�(�*�+�=�!�F�]�T�1�F�:�S��Z�G�%�&�(,�-�E�
!�6�M�D�0�3�u�:�=��D�E��K�'�$�.��4�v�=��C�d�J��� #�E�
�+�-3�4�6:�;�E��t�{�{�7�#�$��)�#%�D�K�K�� �&(�D�K�K�� ��#��/�/�)�6��@�5�H�
����G�$�Q�'�.�.�z�:��t�����G�,�,�����G�$�T�*�1�1�%�8�-�
�K�K�� ��*�1�1�%�8rc��/p\VPV,4^8wEdhVR8XEd+VPV,EFp^pVPV,V,F�p	VR8wd�V	P4PVP44R8wdTV	P4PVP44R8wd"VP	V.4PV4MSV	P4PVP44R8wd"VP	V.4PV4V^,
pK�	EK	V#VPV,P
V4R8XdR#^pVPV,V,F�p	VR8wd�V	P4PVP44R8wdTV	P4PVP44R8wd"VP	V.4PV4MSV	P4PVP44R8wd"VP	V.4PV4V^,
pK�	V#)z=Private method shared by remove_option and comment_out_optionNr-)r{r8r]r^r\r[r�)
r:rNr�r�rMr��	to_remover;rmrns
&&&&&&    r�_get_options_to_blacklist� Parser._get_options_to_blacklist�s����	��t�{�{�7�#�$��)��4�� �K�K��0�0�D��B� $���G� 4�T� :� :�� �D�=�!%�
�
�� 1� 1�&�,�,�.� A�R� G� $�
�
�� 1� 1�%�+�+�-� @�B� F� )� 4� 4�T�2� >� E� E�b� I��#�z�z�|�0�0�����@�B�F� )� 4� 4�T�2� >� E� E�b� I��a���!;�1�H��-�;�;�w�'�+�+�H�5��=���B� $���G� 4�X� >� >�� �D�=�!%�
�
�� 1� 1�&�,�,�.� A�R� G� $�
�
�� 1� 1�%�+�+�-� @�B� F� )� 4� 4�X�r� B� I� I�"� M�� $�z�z�|�0�0�����@�B�F� )� 4� 4�X�r� B� I� I�"� M��a���!?� �rc��VPWVWE4pVF@p^pWg,F/p	W�,
p
VPV,V,V
V^,
pK1	KB	R#)aRemove an option from a section.

section= the section which will have the option removed
option= the option to remove
value= if you want to remove an option only if it has a certain value
position= e.g. 0 (i.e. the first element in the list of Screen
              sections)N)r�r8)r:rNr�r�rMr�r��part�moddedrn�realposs&&&&&&     rr��Parser.remove_option&s_���2�2�7�E�2:�G�	��D��F�!�����-���K�K��(��.�w�7��!���(�rc�h�\VPV,4pWP9d�VR8wd�RpRpVPV,FrpVPWV4'gKVPVVV4P	4P4VP	4P48XdRpMKt	V'dN.VPV,V&VPWVVR7VPV,PW#34V#\RV,4h.VPV,V&V# \deTPYT4FIpTP	4P4TP	4P48XgKDRpEK_	EKei;i)a�Create a new section and return the position of the section

The position is relative to the list of sections of the same type
(e.g. "Screen") so as to make it available in case the user wants
to add some options to it.

The identifier and the position of the new section is added to 
self.identifiers[section]

section= the section to create
identifier= the identifier of a section (if the section requires
            an identifier)Nr�TFr�z!%s Section requires an identifier)r{r8r3r�rYr]r�r�r6r[r)r:rNrLrMr��create�subr;s&&&     r�make_section�Parser.make_section9s�������G�,�-���o�o�%��T�!�%�����;�;�w�/�/�C��~�~�g�s�;�;�
*� $���w�.4�.1�!3�38�5�7�5�5�7�1;�1A�1A�1C�1I�1I�1K�!L�*/�� %�!L�0�"�57�D�K�K��(��2��O�O�G�:�-5�$�7��$�$�W�-�4�4�j�5K�L���	*�+N�-4�,6�8�8�.0�D�K�K�� ��*����1 .�*�(,���w��(L��$(�J�J�L�$6�$6�$8�'1�'7�'7�'9�'?�'?�'A�%B�-2�F�$)�)M�*�s �)AE�AF1�#F1�*F1�0F1c�F�/pV'd&VPW4pVPVR4MmVR8wd,VPWR7'dVPVR4M;\	VP
V,P
44p/PV4pWP9dx^pVPV,F^p\	VP
44PV^,4p	Wt\	VP
44V	,&V^,
pK`	\	VP
44p
V
P4^pV
F�pVPW4p
V
F"pVP
VP,VK$	VP!W4VP
V,VWL,pVR8wgKrW�,
pVPV,VV^,
pK�	R# \dEL_i;i \dL�i;i \dK�i;i)z/Remove Sections by identifier, position or typeNry)�get_positionr\rr��listr8�keysr5r3r6�index�
ValueError�sort�get_subsectionsr.r`�_remove_comment_entries)r:rNrLrMr��pos�allkeysrmr��ref�
sorted_remover�rt�subsectionsr��identrefr�s&&&&             r�remove_section�Parser.remove_sectionrs���
�	��
��'�'��<���$�$�S�$�/�
��
����w��:�:��$�$�X�t�4���4�;�;�w�/�4�4�6�7�G����G�,�I��o�o�%��B�!�-�-�g�6�6�	���y�~�~�/�0�6�6�y��|�D�C�=?�d�9�>�>�#3�4�S�9�:��a���
7��Y�^�^�-�.�
�������!�D��.�.�w�=�K�#������D�O�O�4�S�9�#�
�(�(��7����G�$�T�*�!��H��4��"�+���$�$�W�-�g�6��!���1"��='�
��
��,"����� ����s6�#G.�AH�+H�.G=�<G=�H�
H�H �H c�0�VPWVVRR7R#)a�Add a reference to a section from another section.

For example:
to put a reference to the Screen section named "Default Screen"
in the ServerLayout section you should do:

section='ServerLayout'
reference='Screen'
identifier='Default Screen'
position=0 #the first ServerLayout section

NOTE: if position is set to None it will add such reference to any
instance of the section (e.g. to any ServerLayout section)T�r�rMr�N)r��r:rNr�rLrMs&&&&&r�
add_reference�Parser.add_reference�s��	
����*�!)�T�	�	;rc�0�VPWVVRR7R#)a�Remove a reference to a section from another section.

For example:
to remove a reference to Screen "Default Screen" from the
ServerLayout section you should do:

section='ServerLayout'
reference='Screen'
identifier='Default Screen'
position=0 #the first ServerLayout section

NOTE: if position is set to None it will remove such reference from
any instance of the section (e.g. from any ServerLayout section)Tr�N)r�r�s&&&&&r�remove_reference�Parser.remove_reference�s ��	
���7�Z�$,��	�	>rc���VR8XdVPpMVPR4VRTp/PV4pVF�p.WV&/pVPWVRR7pV'gK(VPR4VRVF<p	V	PR4V	RV	Fp
V	'gK
VPV
4K 	K>	\VP44FpWV,PV4K	K�	V# \d.pL�i;i \d!T	'dTPT	4K�K�i;i \dT'dTPT4L�i;i)aGet references to other sections which are located in a section.

section= the section (e.g. "Screen")
position= e.g. 0 stands for the 1st Screen section
reflist= a list of references which this function should look for.
         The default list of references is self.require_id but this
         list can be overridden by the reflist argument so that, for
         example, if reflist is set to ['Device'], this function will
         look for references to other devices only (references to,
         say, screens, will be ignored).NrJT�r�r-)	r3r[r5r�rr\r�r�r�)r:rNrMrxrOr4r��reference_dictr�r;�extrefr�s&&&&        rr��Parser.get_references�s\���d�?��o�o�G�

�N�N�2������G��[�[��)�
��F�!#�J���N�
��n�n�W�h�$�n�O���s�7��J�J�r�N��B�� #��@� �K�K��O� $�R��*.��#'�4�$2�$=�$=�f�$E�+/�	!$�"&�n�&9�&9�&;�!<�I��&�-�-�i�8�"=�3�6���-#�
���
�� .�@�#� .� 9� 9�$� ?� $�@��&�7��&�1�1�#�6��7�sZ�C:�'D;�D
�$D
�9D;�:
D
�	D
�
D8� D8�1D;�7D8�8D;�;E"�E"�!E"c��\VPVP,4pVR8XEd;VPV,EF pRpVPVP,F�pVPVP,V,PR4V8XgK=VPVP,V,PR4V8XgKwVPVP,V,PR4V8XgK�RpK�	V'gK�/;q�PVP,V&WR&W(R&.VR&WXR&?V^,
pEK#	R#RpVPVP,F�pVPVP,V,PR4V8XgK=VPVP,V,PR4V8XgKwVPVP,V,PR4V8XgK�RpK�	V'd6/;q�PVP,V&WR&W(R&.VR&W8R&?R#R#)a�Create a new subsection inside of a section.

section= the section to which the subsection will belong
identifier= the name of the subsection
position= the position of the section in the dictionary with the
          sections (e.g. the 1st "Screen" section would be 0).
          If set to None, it will create a new subsection in all
          the instances of the said section (e.g. in all the
          "Screen" sections)NTrNrLrMFrO)r{r8r.r�)	r:rNrLrMrqr;r�r�rps	&&&&     r�make_subsection�Parser.make_subsections
������D�O�O�4�5�	��t�����G�,�,�����;�;�t���7�7�C����D�O�O�4�S�9�=�=�i�H�� ����D�O�O�4�S�9�=�=�l�K�"�#����D�O�O�4�S�9�=�=�j�I���!&��8��6�JL�L�I���D�O�O� <�Y� G�+2�i�(�.8�l�+�+-�I�i�(�,0�j�)�!���N�I�)-�0�F��{�{�4�?�?�3�3���K�K����0��5�9�9�)�D����K�K����0��5�9�9�,�G����K�K����0��5�9�9�*�E���"�F�4��FH�H�	�K�K����8��C�'.�)�$�*4�,�'�')�	�)�$�(0�*�%��
rc���\VPVP,4p.pVR8Xd�VPVP,F�pVPVP,V,PR4V8XgK=VPVP,V,PR4V8XgKwVP	V4K�	M�VPVP,F�pVPVP,V,PR4V8XgK=VPVP,V,PR4V8XgKwVPVP,V,PR4V8XgK�VP	V4K�	VF!pVPVP,VK#	R#)a�Remove a subsection from one or more sections.

section= the section to which the subsection belongs
identifier= the name of the subsection
position= the position of the section in the dictionary with the
          sections (e.g. the 1st "Screen" section would be 0).
          If set to None it will remove a subsection from all the
          instances of the said section (e.g. in all the "Screen"
          sections)NrNrLrM)r{r8r.r�r[)r:rNrLrMrqr�r;�items&&&&    r�remove_subsection�Parser.remove_subsectionDsc������D�O�O�4�5�	��	��t�����D�O�O�4�4���K�K����0��6�:�:�9�E����K�K����0��6�:�:�<�H����$�$�T�*�5����D�O�O�4�4���K�K����0��6�:�:�9�E����K�K����0��6�:�:�<�H����K�K����0��6�:�:�:�F����$�$�T�*�5��D����D�O�O�,�T�2�rc�	�Rp.p.p	VR8XdVPWV4MVPWVVR7VR8Xd)RV,R,\V4,R,p
MQRV,R,V,V,V,R,V,\V4,V,R,p
\VPVP,4pV^8Xd'RVRVR./VPVP,^&VR8XEd�\VPV,4p^p
W�8d�VPVP,F�pVPVP,V,PR	4V
8XgK=VPVP,V,PR4V8XgKwVPVP,V,PR4V8XgK�VP
V
4K�	V
^,
p
K�\V^,4FpW�9gKVPWVR7K 	VPVP,F�pVPVP,V,PR4V8XgK=VPVP,V,PR4V8XgKwV	P
V4K�	EM<VPVP,F�pVPVP,V,PR	4V8XgK=VPVP,V,PR4V8XgKwV	P
V4K�	\V	4^8Xd�\VPVP,4pRVRVR.R	V/VPVP,\VPVP,4&V	P
V4V	F=pVPVP,V,R,P
V
4K?	R#)
a}Add an option to one or more subsections.

section= the section which contains the subsection
identifier= the identifier of the SubSection (e.g. Display)
option= the option to add
value= the value which will be assigned to the option
option_type= if set to "Option" it will cause the option to look like
             the following:
             Option "NameOfTheOption" "Value"
            
             Otherwise it will look like the following:
             NameOfTheOption "Value"
position= e.g. 0 (i.e. the option will be added to a subsection which
          is located in the first element in the list of Screen
          sections)rPNryrSrTrNrLrOrM)	�remove_suboptionr}r{r8r.r�r[�ranger�)r:rNrLr�r�r�rMr��
not_to_create�	to_modifyr�rq�cursect_lengthrmr;r�s&&&&&&&         r�
add_suboption�Parser.add_suboptionds���$���
��	��t���!�!�'�v�>��!�!�'�v�*2�
"�
4��$���6�M�D�(�3�u�:�5��<�E��K�'�$�.��7�&�@�6�I���"�#�%(��Z�0�28�9�;?�@�E�����D�O�O�4�5�	���>�/8�'��*�i��/5�D�K�K����(��+��t��!����W�!5�6�N��B��%� �K�K����8�8�D����D�O�O�4�T�:�>�>�z�J������D�O�O�4�T�:�>�>�y�I�� ����D�O�O�4�T�:�>�>�|�L�"�#�%�,�,�R�0�9��a����>�A�-�.���)��(�(��q�(�I�/����D�O�O�4�4���K�K����0��6�:�:�<�H����K�K����0��6�:�:�9�E����$�$�T�*�5����D�O�O�4�4���K�K����0��6�:�:�:�F����K�K����0��6�:�:�<�H����$�$�T�*�5��9�~��"�����D�O�O� <�=�	��G�\�:��B�
�H�6����D�O�O�,��D�K�K����0�1�3�� � ��+��D��K�K����(��.�y�9�@�@��G�rc�P�/p\VPV,4^8wEd\VPVP,4^8wEd�VPVP,EF�pVPVP,V,pVR8Xd�VPR4V8Xd�VPR4V8Xd�^pVR,F{p	V	P	4P4P
VP	4P44R8wd"VPV.4PV4V^,
pK}	M�VPR4V8Xd�VPR4V8Xd�VPR4V8Xd�^pVR,F{p	V	P	4P4P
VP	4P44R8wd"VPV.4PV4V^,
pK}	?EK�	V#)z�Get a dictionay of the suboptions to blacklist.

See add_suboption() for an explanation on the arguments.

Used in both remove_option() and remove_suboption()NrNrLrOrMr-)	r{r8r.r�rYr]r^r\r[)
r:rNrLr�rMr�r;�	temp_elemrm�opts
&&&&&     r�_get_suboptions_to_blacklist�#Parser._get_suboptions_to_blacklist�s����	��t�{�{�7�#�$��)��4�;�;�t���/�0�A�5� �K�K����8�8�D� $���D�O�O� <�T� B�I��4�'�%�M�M�)�4��?�%�M�M�,�7�:�E�!"�B�'0��';�';��$'�I�I�K�$5�$5�$7�%)�T�&�,�,�.�*>�*>�*@�%A�R�%H�$-�$8�$8��r�$B�$I�$I�"�$M� "�a���	(<��&�M�M�)�4��?�%�M�M�,�7�:�E�%�M�M�*�5��A�!"�B�'0��';�';��$'�I�I�K�$5�$5�$7�%)�T�&�,�,�.�*>�*>�*@�%A�R�%H�$-�$8�$8��r�$B�$I�$I�"�$M� "�a���	(<�
"�+9�,�rc���VPWW44pVFQp^pWV,F@pW�,
p	VPVP,V,R,V	V^,
pKB	KS	R#)z#Remove an option from a subsection.rON)r�r8r.)
r:rNrLr�rMr�r;r�r��real_poss
&&&&&     rr��Parser.remove_suboption�sf���5�5�g�6<�H�	��D��F�!�����=���K�K����0��6�y�A�(�K��!���(�rc��RW3,pVPV,FpV^,V8XgKV^,u#	\T4h \d\hi;i)z;Get the identifier of a specific section from its position.z1No identifier can be found for section "%s" No %d)r6r`rr)r:rNrM�	error_msgrts&&&  r�get_identifier�Parser.get_identifier�sk��I��)�*�	�	#��(�(��1�1����7�h�&���7�N�2�
"�)�,�,���	#�"�"�	#�s�!A
�
A
�A
�
Ac�t
�V'dwRVP4P49dR#VP4P4PVP4P44'gR#.pRp^p^pVPR4p	V	^8�EdJVEFAp
V	R9d�VR8Xd�V
P	4'gaV
R8XdCV^8wd2V^,^8wd$\V4^8�dVP
V4RpV^,
pM�V^,^8wd	Wj,
pM�V^,^8wd	Wj,
pMjV
P	4'gV
R8XdV^,
pMCWj,
pM:V^,^8wd
Wj,
pM#\V4^8�dVP
V4RpV\V4^,
8XdVR8wdVP
V4V^,
pEKD	M�VF}p
V
P	4'g
Wj,
pM#\V4^8�dVP
V4RpV\V4^,
8XdVR8wdVP
V4V^,
pK	\V4pV^8�Ed|VPUu.uF q�P4P4NK"	p
pVR8wd�V^8Xd�V^8Xd�V^,P4P4V
9d�Rp\V^,P44pVPFMpV^,P4P4VP4P48XgKKTpM	VPW�4pV.#V	^8wdCVR8wd<RpVF*pVP4VP48XgK(RpK,	VR8XdR#V^8Xd-V^,P4P4R8XdR#VPUu.uF q�P4P4NK"	ppV	^8XdsVR8XdlVP4P4R8Xd\V4^8XdV^/pVFpVPV4K	\VP!44#V	^8�dV	^8:dW[^,
,#V	^8�dV^V#V	^8XdV^R	P#V4#R
#V	R9d
VR8XdV#R#uupi \dR#i;i \dEL�i;iuupi)z�Clean the option and return the value

This returns the last item of the list which this method generates.

If no value can be found, return False.r�FrJrPr$T�True�inputdevice� N)��)rYr]rZr�r�r{r[r4�intr3rrr�r1r\r�r��join)r:r��optnamer�rNr�r�rmr�r�r��optlen�x�references_listrtr�r�rL�statusr;r1�server_dicts&&&&&                 r�
_clean_option�Parser._clean_option�sx����6�<�<�>�/�/�1�1���<�<�>�'�'�)�4�4�W�]�]�_�5J�5J�5L�M�M������
���	��<�<��$���a�<����v�%�'�^�*C��9�9�;�;���8�(�A�~�)�a�-�1�2D�#&�v�;��?�$+�N�N�6�$:�-/�F�%��N�I�(�1�}��1� &����%�q�=�A�-�"�K�F���9�9�;�;���8�%��N�I�"�K�F�%�q�=�A�-�"�K�F� #�6�{�Q�� '���v� 6�)+����V��q��(���|����v�.��a���M�P���y�y�{�{��K�F��6�{�Q�����v�.�!#����V��q��(���|����v�.��a���� �W����A�:�
;?�/�/�J�/�Q�w�w�y���0�/�O�J��>�)��Q��6�Q�;���
� � �"�(�(�*�o�=�
��D����
� 0� 0� 2�3�E� $����"�1�:�+�+�-�3�3�5�����9K�9K�9M�M�#'�D�!�!0�%�%)�%8�%8��%E�
� *�|�+��1�}��N�!:���#�D��z�z�|�w�}�}��6�!%��$��U�?� ���{�w�q�z�/�/�1�7�7�9�X�E��9=���G���
�
��*�*�,��H�G��1�}��N�!:��M�M�O�)�)�+�}�<���L�A�%���
� ��#�D��*�*�4�0�$��K�,�,�.�/�/��A��(�a�-��q�y�)�)��A���A�J����Q���A�J��x�x��(�(���6�!�g��&?�����IK��(0�%�$�%��!�����"HsC�
&T�5A4T#�.T#�5T�&T5�T �T#�T � T#�#T2�1T2c�`�.pVPV,PV4R8Xd\hVPV,V,PR4R# \Ed�TR8Xd\R4hTPT,EF�pTPT,T,PR4T8XgK4TPT,T,PR4T8XgKdTPT,T,PR4T8XgK�TPT,T,R,F�p	TP
4P4T	P
4P49gKDT	P
4PR4R8wd2T	P
4^T	P
4PR4p
MT	P
4p
TPTPT
Y&R	74K�	EK�	\T4^8Xd\h\T4^8�dTu#T^,u# \dR#i;i\Ed4TPT,T,F�pTP
4P4TP
4P49gKDTP
4PR4R8wd2TP
4^TP
4PR4p
MTP
4p
TPTPY�YaR
74K�	\T4^8Xd\h\T4^8�dTu#T^,u# \dR#i;i\d\hi;i)a�
Get the value which is assigned to an option.

Return types:
  * string (if only one value is available)
    - usually in options
  * list (if more than one option is found)
    - having multiple references of the same type is allowed.
      for example it is not unusual to have 2 references to
      Screen sections in the ServerLayout section (in case of
      Xinerama)
    - if the options are actually options and not references
      then there are duplicate options, which should be detected
      in advance with get_duplicate_options()   
  * None (if no value can be found) - Not always true -> See below.

Use-case for returning None
  * When dealing with incomplete references. For example:
        Screen "Configured Screen"
      is different from:
        Screen
        (which is an incomplete reference)
  * When dealing with incomplete options. For example:
        Depth 24
      is different from:
        Depth
        (which is an incomplete option)
  * Exception:
      Some options (with the "Option" prefix) (not references)
      can be used with no value (explicitly) assigned and are
      considered as True by the Xserver. In such case get_value()
      will return "True". For example:
        Option "AddARGBGLXVisuals" 
      is the same as:
        Option "AddARGBGLXVisuals" "True"

Meaning of keys in Sections and SubSections:
  * When dealing with a Section:
      section= e.g. 'Screen', 'Device', etc.
      option= the option
      position= e.g. 0 (i.e. the first element in the list of Screen
                sections)
      reference= used only by get_references()

  * When dealing with a SubSection:
      section= 'SubSection' (this is mandatory)
      option= the option
      position= e.g. 0 would mean that the subsection belongs to 
                the 1st item of the list of, say, "Screen" sections.
                (i.e. the first element in the list of Screen 
                sections)
                ["position" is a key of an item of the list of 
                subsections see below]
      identifier= the name of the subsection e.g. 'Display'
      sect = the 'section' key of an item of the list of 
             subsections e.g. the "Display" subsection can be 
             found in the "Screen" section ('sect' is the latter)

Anatomy of Sections and SubSections:
  * Anatomy of subsections:
      self.globaldict['SubSection'] =
          {0: {'section': 'Screen', 'identifier': 'Display', 
           'position': 0, 'options': [option1, option2, etc.], 
           etc.}
          In this case we refer to the 'Display' subsection 
          which is located in the first 'Screen' section.

  * Anatomy of a section:
      self.globaldict['Screen'] =
          {0: [option1, option2, etc.], 1: [...], ...}
      0, 1, etc. is the position N�fooz)An identifier is required for subsectionsrLrMrNrOrKr�)r�rNr-)r8r�rr�r��	ExceptionrYr]r^r[rr{rr�r�r`)r:rNr�rMrLrtr��valuesr;r��stropts&&&&&&&    rr��Parser.get_value�s��R���;�;�w��#�#�H�-��5�"�"�=
&����G�$�X�.�4�4�U�;��!� 
(���%�#�%2�3�3�!%���G� 4� 4�� �K�K��0��6�:�:�<�H�&�'� �K�K��0��6�:�:�:�F�$�%� �K�K��0��6�:�:�9�E��M�'+�{�{�7�';�D�'A�)�'L�'L��$*�L�L�N�$8�$8�$:�$'�I�I�K�$5�$5�$7�%8�'*�y�y�{�'7�'7��'<��'B�14����Q��=B�U�W�T�T�#�Y�2P��25�����$*�M�M�$�2D�2D�V�28�3E�3O�%P�(M�
!5�$�6�{�a�'�-�-��6�{�Q��%�
�(�#)�!�9�,��)�(�#'�(���
$� �K�K��0��:�:�D��|�|�~�+�+�-�����1C�1C�1E�E��:�:�<�,�,�S�1�R�7�%)�Z�Z�\�!�T�Z�Z�\�5F�5F�s�5K�%L�F�%)�Z�Z�\�F��
�
�d�&8�&8��09�'9�'L�M�;��v�;�!�#�)�)��v�;��?�!�M�$�%�a�y�(��%�$�#�$���
&�%�%�
&�s��)A�A N-�+N-�1+N-�!A N-�B8N-�I�	N-�I�N-�I�N-�)AN-�B3N-�>N	�N-�	N�N-�N�N-�%N-c���VR8wdVPW4R#VR8wd&VPV,PV4R8g#Rp\	V4h \dR#i;i)ziSee if a section with a certain identifier exists.

NOTE: either identifier or position must be provided.NTFz.Either identifier or position must be provided)r�rr8r�r)r:rNrLrMrs&&&& rr��Parser.is_section#so��
���
��!�!�'�6����
��;�;�w�'�+�+�H�5��=�=�H�I��I�&�&��
'�
��
�s�A�A$�#A$c�*�RV:RV:R2pVPV,FUpV^,P4P4VP4P48XdV^,u#KW	\	V4h \dKri;i)z;Get the position of a specific section from its identifier.zNo z section named "z" can be found)r6rYr]r�r)r:rNrLrrts&&&  rr��Parser.get_position4s����z�+�	��$�$�W�-�-�D�
���7�=�=�?�(�(�*�j�.>�.>�.@�.F�.F�.H�H���7�N�I�.�"�)�,�,��"�
��
�s�AB�B�Bc��/PVP4p/pVPF@p/W#&/W&VPV,FpVPVV4W#,V&K 	KB	VF�pW#,F�pW#,V,F�p\	W#,V,V,4^8�gK)W#,V,V,F{pVP
F8pVP
4VP4P
48XgK6TpK:	VPWg4'dKdW,PV4K}	K�	K�	K�	V#)a4Look for references to sections which don't exist

This returns a dictionary having the items of self.require_id as keys
and a dictionary with the identifiers of the sections which are
being referred to by the broken references.

For example:

broken_references = {
                    'InputDevice': {'InputDevice 1': None,
                                    'Another input device': None},
                    'Device': {...},
                    'Monitor' {...},
                    'Screen' {...},
                    'ServerLayout' {...}
                    })
r5r3r8r�r{r1r]rYr�r\)r:�broken_references�references_treerNrtr;�refsectr�s&       rr�Parser.get_broken_referencesAs1��$�K�K����8�������G�')�O�$�)+��&����G�,�,��15�1D�1D�W�EI�2K��(��.�-�'�'�G�'�0�0��.�7��=�=�G��?�3�D�9�'�B�C�a�G�#2�#;�D�#A�'�#J�#J�C�(,�
�
��#'�:�:�<�7�=�=�?�3H�3H�3J�#J�.2�G�)6�$(�?�?�7�#@�#@�!2� :� E� E�c� J�$K� >�1�'� !� rc���.pVPR,p^pVF�pVPRRV4pV'd�^pVPR,FlpV^,P4P	4VP4P	48XgKKVPV^,4V^,
pKn	V^8XdRp\
V4hT^,
pK�	V# \dLi;i)z�Return a list with the position of default ServerLayout sections

NOTE: If the section set as the default ServerLayout doesn't exist
      it will raise a ParseException.r%�DefaultServerLayoutr$rz)r8r�r6r]rYr[rr)	r:�default�serverflagsrm�flagr��def_itrLrus	&        rr��Parser.get_default_serverlayoutos������k�k�-�0��
���D�
�!%���
�/D�b�"J��!��F�&*�&6�&6�~�&F�&F�
�&�q�M�/�/�1�7�7�9�*�0�0�2�8�8�:�;�#�N�N�:�a�=�9�"�a�K�F�	'G�
��{�!K��,�U�3�3�
�!�G�B�% �&���#�
��
�s�A6C!�9C!�!C/�.C/c��VR,EF%pVR,V,R,pVR,V,R,pVR,V,PR4pVR,V,R,pW,PV.4PR
V,R,R,4\V4^8�d>W,V,PRRP	V4,R	,4K�W,V,PRP	V4R	,4EK(	VRV# \
dT#i;i)z<Put SubSections back into the sections to which they belong.rrNrLrMrOrPrTrSz	EndSubSection
z
	SubSection ")r�r\r[r{r
r`)r:rprtrNrLrMrOs&&     r�_merge_subsections�Parser._merge_subsections�sJ���l�+�+�D���-�d�3�I�>�G�"�<�0��6�|�D�J� ��.�t�4�8�8��D�H���-�d�3�I�>�G���)�)�(�B�7�>�>�=@�BL�=M�<?�=@�BF�=G�
H��7�|�a���"�8�,�3�3�D�48�I�I�g�4F�5G�4G�5H�I��"�8�,�3�3�D�I�I�g�4F�4G�5H�I�,� 	��,�'�����	����	�s�5D:�:E	�E	c	���\P!VP4pVPV4pVP	V4p.pRPVP4R,pVPV4VF�pW`P8wgK\W6,4^8�gK-W6,F]pVPRV,R,R,4VPRPW6,V,4R,4K_	K�	?\VR4'gTV'd\VR4pM\VR4pVPRPV44VP4R
#VP\\RPV4R444R
# \ d%TPR	PT44R
#i;i)aqWrite the changes to the destination

The destination can be either a file (e.g. /etc/X11/xorg.conf)
or a file object (e.g. sys.stdout).

destination = the destination file or file object (mandatory)
test = if set to True write will append the result to the
       destination file instead of overwriting it. It has no
       effect on file objects. Useful for testing.rJrTrPzEndSection

rH�a�wzUTF-8rNz	Section ")�copy�deepcopyr8�_merge_commented_optionsr*r
r7r[r/r{rUrVrHrXr}�bytes�	TypeError)r:�destination�testrp�linesr7rNr;s&&&     rrH�Parser.write�sv���M�M�$�+�+�.�	��1�1�)�<�	��+�+�I�6�	����7�7�4�=�=�)�D�0��
���X�� �G��-�-�-��y�)�*�Q�.� )� 2� 2�����%5��%?�#�%E��%L�M����R�W�W�Y�-?��-E�%F�%5�&6�7�!3�!�
��{�G�,�,��"�;��4��"�;��4�����b�g�g�e�n�-�����
3��!�!�#�e�B�G�G�E�N�G�&D�"E�F���
3��!�!�#�(�(�5�/�2�
3�s�;3F0�0+G�Gc�<�.pVPVP,FxpVPVP,V,R,V8XgK5VPVP,V,R,V8XgKgVPV4Kz	V#)z.Get all the subsections contained in a sectionrNrM)r8r.r[)r:rNrMr�r�s&&&  rr��Parser.get_subsections�sw�����;�;�t���/�/�C����D�O�O�,�S�1�)�<��G��K�K����0��5�j�A�X�M��"�"�3�'�0�
�rc���VEF]pVPVP,V,R,pVPVP,V,R,pVPVP,V,PR4pVPVP,V,R,pVPP	R
V,R,R,4VFPpRVP4,pVPP	V4VPP	R4KR	VPVP,VEK`	R	# \dEKsi;i)aPut SubSections back into their sections and comment them out

This alters globaldict and should be used only in
comment_out_section() i.e. when the whole section is being
commented out.

subsections = the list of the indices subsections to merge and
removerNrLrMrOrPrT�#		%s
�#	EndSubSection
Nz#	SubSection ")r8r.r�r7r[rYr`)	r:r�rtrNrLrMrOr�r�s	&&       r�_permanent_merge_subsections�#Parser._permanent_merge_subsections�s�� �D��k�k�$�/�/�2�4�8��C�G����T�_�_�5�d�;�L�I�J��{�{�4�?�?�3�D�9�=�=�j�I�H��k�k�$�/�/�2�4�8��C�G��M�M� � �!7�*�!D�s�!J�!%�"&�
'�"��!�V�\�\�^�4���
�
�$�$�S�)��
�
�$�$�%9�:�"�

��K�K����0��6� ���
��
�s�E'�'E7�6E7c�h�.pVPVP,PV4'd~VPVP,V,FUpVPVP,V,V,PR4V8XgKDVPV4KW	V#)zBReturn the index of the entry in the Comments section of a sectionrM)r8r/r�r[)r:rNrMr7rts&&&  r�
_get_comments�Parser._get_comments�s������;�;�t�*�*�+�/�/��8�8����D�$7�$7�8��A�A���K�K�� 3� 3�4�W�=�d�C��S��_��1��O�O�D�)�B�
�rc��RpVEFpVPVP,V,R,pVPVP,V,R,pVPVP,V,PR4pVPVP,V,R,pRV,pVPWF4p	V	'g�/VPVP,V&/VPVP,V,V&VPVP,V,V,p
RV
R&WjR&RV
R&.V
R&?
VPVP,V,V,R,pVPV4VF+pRVP
4,p
VPV
4K-	VPV4VPVP,VEK	R#)	a3Put SubSections back into their sections and comment them out

This alters globaldict and should be used only to comment out
subsections (i.e. in comment_out_subsection()) when the whole section
is not being commented out.

subsections = the list of the indices subsections to merge and
              remover<rNrLrMrOz#	SubSection "%s"
Nr;)r8r.r�r@r/r[rY)r:r��end_subsectionrtrNrLrMrO�start_subsectionr7rp�comments_optionsr�r�s&&            r� _merge_subsections_with_comments�'Parser._merge_subsections_with_comments
s���.���D��k�k�$�/�/�2�4�8��C�G����T�_�_�5�d�;�L�I�J��{�{�4�?�?�3�D�9�=�=�j�I�H��k�k�$�/�/�2�4�8��C�G�5��D���)�)�'�<�H��<>����D�/�/�0��9�FH����D�/�/�0��9�(�C� �K�K��(;�(;�<�W�E�h�O�	�*.�	�,�'�(0�*�%�'+�	�)�$�')�	�)�$��#�{�{�4�+>�+>�?�� -�-5� 7�7@� B��
�#�#�$4�5�!��!�V�\�\�^�4�� �'�'��,�"�
�#�#�N�3����D�O�O�,�T�2�= rc�J�VPW4pVPV4R#)z-Comment out all the subsections of a section.N)r�r=)r:rNrMr�s&&& r�_comment_out_subsections�Parser._comment_out_subsections6s"���*�*�7�=���)�)�+�6rc��VPW4pVF(pVPVP,V,VK*	R#)zBRemove comment sections of a "section" from the "Comments" sectionN)r@r8r/)r:rNrMr7�comment_sections&&&  rr��Parser._remove_comment_entries<s:���%�%�g�8��'�O����D�/�/�0��9�/�J� (rc��RV,pRp/pV'd&VPW4pVPVR4MmVR8wd,VPWR7'dVPVR4M;\	VP
V,P
44p/PV4pWP9dx^p	VPV,F^p
\	VP
44PV
^,4pW�\	VP
44V,&V	^,
p	K`	\	VP
44pVP4^p
VF�pVPPV4VP
V,V,F5pRVP4,pVPPV4K7	VP!W4VPPV4VP#W4VP
V,VWn,pVR8wgK�VV
,
pVPV,VV
^,
p
K�	R# \dEL�i;i \dELYi;i)z.Comment out a section and all its subsections.z
#Section "%s"
z#EndSection
Nryz#	%s
)r�r\rr�r�r8r�r5r3r6r�r�r�r7r[rYrIr�)r:rNrLrM�
start_section�end_sectionr�r��all_keysrmr�r�r�r�rtr��commented_option�	ident_refr�s&&&&               r�comment_out_section�Parser.comment_out_sectionCs.��,�w�7�
�%��
�	��
��'�'��<���$�$�S�$�/�
��
����w��:�:��$�$�X�t�4���D�K�K��0�5�5�7�8�H����H�-�I��o�o�%��B�!�-�-�g�6�6�	���y�~�~�/�0�6�6�y��|�D�C�=?�d�9�>�>�#3�4�S�9�:��a���
7��Y�^�^�-�.�
�������!�D��M�M� � ��/��+�+�g�.�t�4�4��#,�����#?� ��
�
�$�$�%5�6�5�
�)�)�'�8��M�M� � ��-�
�(�(��7����G�$�T�*�"��I��D� �#�f�,���$�$�W�-�g�6��!���3"��='�
��
��,"����s$�#I�AI-�I*�)I*�-I<�;I<c�8�.pVPVP,FepVPVP,V,pVR,V8Xd0VR,V8Xd"VR,V8XdVPV4M?Kg	VPV4R#)z�Comment out a subsection.

section= the type of the section which contains the subsection
identifier= the identifier of the subsection
position= the position of the sectionrNrLrMN)r8r.r[rF)r:rNrLrMr�r.rps&&&&   r�comment_out_subsection�Parser.comment_out_subsection�s������+�+�d�o�o�6�6�J����D�O�O�4�Z�@�I��)�$��/��,�'�:�5��*�%��1��"�"�:�.���7�	
�-�-�k�:rc��VPWVWE4pVEF�p^pWg,EF�p	W�,
p
RVPV,V,V
,P4,VPV,V,V
&VPVP,P	V/4\VPVP,V,4pVPVP,V,pVP	V/4W�,P	RR4W�,P	RV4W�,P	RR4W�,P	R.4W�,R,P
VPV,V,V
,4?VPV,V,V
V^,
pEK�	EK�	R#)a-Comment out an option in a section.

section= the section which will have the option commented out
option= the option to comment out
value= if you want to comment out an option only if it has a
       certain value
position= e.g. 0 (i.e. the first element in the list of Screen
              sections)�#%srLNrMrNrO)r�r8rYr/r\r{r[)
r:rNr�r�rMr�r�r�r�rnr�rqrps
&&&&&&       r�comment_out_option�Parser.comment_out_option�s}���2�2�7�E�3;�H�	��D��F�!�����-��7<����G�,�T�2�7�;�A�A�C�8E����G�$�T�*�7�3����D�/�/�0�;�;�G�R�H�����D�,?�,?� @�� I�J�	� �K�K��(;�(;�<�W�E�	��$�$�T�2�.���*�*�<��>���*�*�:�t�<���*�*�9�d�;���*�*�9�b�9���	�*�1�1�*.�+�+�g�*>�t�*D�W�*M�O���K�K��(��.�w�7��!���+(�rc��VPWW44pVEF�p^pWV,EF�pW�,
p	RVPVP,V,R,V	,P4,VPVP,V,R,V	&VPVP,PVP/4VPVP,VP,p
V
PV/4W�,PRV4W�,PRV4W�,PRV4W�,PR.4W�,R,pVPVP,V,R,V	,pVP
V4?
VPVP,V,R,V	V^,
pEK�	EK�	R#)a@Comment out an option in a subsection.

section= the section which contains the subsection
identifier= the identifier of the subsection
option= the option to comment out
position= the position of the section which contains the subsection
          e.g. 0 (i.e. the first element in the list of Screen
          sections)rZrOrLrMrNN)r�r8r.rYr/r\r[)
r:rNrLr�rMr�r;r�r�r�rprErRs
&&&&&        r�comment_out_suboption�Parser.comment_out_suboption�s����5�5�g�6<�H�	��D��F�!�����-��JO��{�{�4�?�?�3�D�9�)�D�W�M��U�W�K����D�O�O�,�T�2�9�=�g�F����D�/�/�0�;�;�D�O�O�<>�@� �K�K��(;�(;�<�T�_�_�M�	��$�$�T�2�.���*�*�<��D���*�*�:�t�<���*�*�9�g�>���*�*�9�b�9�#,�?�9�#=� �#'�;�;�t���#?��#E�.7�$9�9@�$B� � �'�'�(8�9���K�K����0��6�y�A�'�J��!���5(�rc���WP,EF�pRpWP,V,EFHpWP,V,V,PR4pWP,V,V,PR4pWP,V,V,PR4pWP,V,V,R,pWPP8XdjW,FZp	W,V	,p
V
R,V8XgK"V
R,V8XgK2V
R,V8XgKBW,V	,R,pEK,	EK1W,PV4pEKK	V'gEKwXF^pRVP4,pW P8Xd$VP	R.4PV4KMVPV4K`	EK�	V#)zAPut commented out options back into their sections or subsectionsNrNrLrMrOz	%s
)r/r�r.rYr\r[)r:rprt�section_options�section_instancerNrLrMrOr�r.r�s&&          rr1�Parser._merge_commented_options�s����1�1�2�2�D�"�O�$-�.A�.A�$B�4�$H�$H� �#�$7�$7�8��>�$4�6�69�c�)�n��&�':�':�;�D�A�'7�9�9<��\�9J��$�%8�%8�9�$�?�%5�7�7:�s�:���#�$7�$7�8��>�$4�6�6?�A���o�o�-�(����%.�_�S�%9�
�&�|�4�
�B�&�z�2�h�>�&�y�1�W�<�.7�o�c�.B�9�.M�O�!�
 /�'0�o�&9�&9�(�&C�O�%%I�(��%�F�%�����8�F����.�'�2�2�9�35�7�7=�v�f�~�'�.�.�v�6�
&�/3�>�r)
r8r7r/r6r4r3r1r0r.r2r?)NNNrP)NNN)NN)5rrr
rrr<rArE�property�
globaldictr9rbrar~r�r�r�r|r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�r�r�rr�r*rHr�r=r@rFrIr�rTrWr[r^r1r�__classdictcell__)�
__classdict__s@rrr*s����@�N�`�"��+�{�3�J�T%�ll,�\-�^"8�H-�^�C�J�"F9�P,�\�&7�r@�F;�$>�$1�f6�p3�@NH�b �F
�-�\�|Q&�f'�"-�+!�\�>�8*3�X
��8
�*3�X7�K�E�P;�($�N(�V"�"rr)�
__future__rr�sysrrr/rrrrr�objectrr	rr�<module>rksT��(&�'�
���	�)�	�	�i�	�	�y�	�	�Y�	�i�V�ir

Youez - 2016 - github.com/yon3zu
LinuXploit