+
    pæÍOèW ã                   ó¬   € ^ RI Ht ^ RI Ht ^ RIt^ RIHtHt ^ RIt ! R R]4      t ! R R]4      t	 ! R	 R
]4      t
 ! R R]4      t ! R R]4      tR# )é    )Úprint_function)Úunicode_literalsN)ÚstdoutÚstderrc                   ó   € ] tR t^tRtRtR# )Ú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.pyr   r      s   † Ù-Ûr   r   c                   ó   € ] tR t^tRtRtR# )ÚOptionExceptionz&Raise when an option is not available.r	   Nr
   r	   r   r   r   r      ó   † Ù0Ûr   r   c                   ó   € ] tR t^"tRtRtR# )ÚSectionExceptionz&Raise when a section is not available.r	   Nr
   r	   r   r   r   r   "   r   r   r   c                   ó   € ] tR t^&tRtRtR# )ÚParseExceptionz&Raise when a postion is not available.r	   Nr
   r	   r   r   r   r   &   r   r   r   c                   ó–  a € ] tR t^*t o RtR0R ltR tR t]! ]]4      t	R t
R tR tR	 tR
 tR tR0R ltR tR1R ltR2R ltR2R ltR0R ltR3R ltR0R ltR0R ltR0R ltR0R ltR0R ltR3R ltR0R ltR0R ltR tR3R lt R2R lt!R3R lt"R t#R  t$R! t%R" t&R0R# lt'R$ t(R% t)R& t*R' t+R( t,R) t-R3R* lt.R+ t/R2R, lt0R0R- lt1R. t2R/t3V t4R# )4ÚParserzVOnly low-level methods here.

See the xutils.XUtils subclass for higher-level methods.Nc                óÄ  € RV n         RV n        Wn        RRRRRRR	R
RRRRRRV P                   V P                  3V n        V P                  RR V n        . ROV n        . ROV n        / P                  V P
                  4      V n        . V n	        / P                  V P                  ^ 4      V n
        V P                   F  p/ V P                  V&   K  	  V P                  4        R# )a  source = 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(   r   r    r"   r#   r$   )r    r   r"   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˜Óñ  ð 	×ÑÖr   c                ó   € V P                   # ©N©r8   )r:   s   &r   Ú_get_globalÚParser._get_global~   s   € Ø�{‰{Ðr   c                ó   € Wn         R # r?   r@   )r:   Úglobal_dicts   &&r   Ú_set_globalÚParser._set_global�   s   € Ø!Žr   c                ó–  € V P                   pVR8X  d   . pMO\        VR4      '       g.   \        VR4      pVP                  4       pVP	                  4        MVP                  4       p/ P                  V P                  ^ 4      pRpRpRpRp^ p	^ p
^ pV EF2  pVP                  4       P                  R4      '       Ed=   VR8X  d   V P                  P                  V4       EMÛWH,          pVR8X  dò   V P                  V P                  ,          P                  V/ 4       V P                  V P                  ,          V,          pVP                  V/ 4       Wí,          P                  RR4       Wí,          P                  R	V4       Wí,          P                  R
R4       Wí,          P                  R. 4       Wí,          R,          P                  VP                  4       4       EMW@P                  ,          pV P                  V P                  ,          P                  V P                  / 4       V P                  V P                  ,          V P                  ,          pVP                  V/ 4       Wï,          P                  RX4       Wï,          P                  R	V4       Wï,          P                  R
V4       Wï,          P                  R. 4       Wï,          R,          P                  VP                  4       4       ?EMÃVP                  4       P                  4       P                  R
4      '       d�   RpV P                    FI  pVP                  4       P#                  RVP                  4       ,           R,           4      R8w  g   KE  RpTp M	  V'       g   RV,          p\%        V4      hVR8X  d   V	^,          p	XpRpRpEMRp\%        V4      hVP                  4       P                  4       P                  R4      R8X  d?   V	^,          p	VR8X  d"   VR8X  d   WH;;,          ^,          uu&   RpRpEM‘Rp\%        V4      hVP                  4       P                  4       P                  R4      R8X  d÷   V
^,          p
VR8X  dÚ   VR8X  dÓ   RpWÌP#                  R4      ^,           VP'                  R4       P                  4       pV P                  P                  V P                  / 4       W@P                  ,          p/ V P                  V P                  ,          V&   V P                  V P                  ,          V,          pWŽR
&    WH,          VR	&   TTR&   . TR&   ?EMiRp\%        V4      hVP                  4       P                  4       P                  R4      R8X  d?   V
^,          p
VR8X  d"   RpW@P                  ;;,          ^,          uu&   MùRp\%        V4      hVR8w  dæ   VP                  4       R8w  dÑ   VR8X  dX   V P                  V P                  ,          X,          R,          P                  RVP                  4       ,           R,           4       MrV P                  P                  V/ 4       WH,          pV P                  V,          P                  V. 4      P                  RVP                  4       ,           R,           4       V^,          pEK5  	  V'       gL   V	^,          ^ 8w  g   V
^,          ^ 8w  d   Rp\%        V4      hV P+                  4        V P-                  4        R# V P+                  4        R#   \(         d    ?Rp\%        T4      hi ; 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.Ú	Ú
zThe last section is incomplete.r-   )r0   ÚhasattrÚopenÚ	readlinesÚcloser5   r1   ÚstripÚ
startswithr7   Úappendr8   r/   Ú
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   &                    r   r9   Ú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                óÜ  € \        V P                  4       4      ^ 8”  d,   R\        V P                  4       4      ,          p\        V4      hV P	                  4        V P                  4       p^ pV F  pV\        W$,          4      ,          pK  	  V^ 8”  d   R\        V4      ,          p\        V4      hV P                   FK  p\        V P                  V,          4      \        V P                  V,          4      8w  g   K@  Rp\        V4      h	  \        V P                  R,          4      ^ 8”  dT   V P                  R,           F<  pV P                  RVR.R7      p\        VR,          4      ^ 8X  g   K1  Rp\        V4      h	  V P                  4       p\        V4      ^ 8”  dM   \        V4      ^8”  d   Rp\        V4      hV P                  RV^ ,          R	7      '       g   R
p\        V4      hR# 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_referencesr3   r8   r6   Úget_referencesÚget_default_serverlayoutÚ
is_section)r:   ru   Úbrokenrm   rN   Úscreen_referencesÚdefault_layouts   &      r   rb   Ú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ñ #r   c                ó®  € V P                    F‰  p. V P                  V&   ^ pV P                  V,           F^  p V P                  VRV4      p TP                  R4       T^ ,          pT P                  T,          P                  YB34       T^,          pK`  	  K‹  	  R#   \        \
        3 d    RY3,          p\        T4      hi ; i  \         d     Lmi ; 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.rJ   N)	r3   r6   r8   Ú	get_valuer   r   r   r[   ÚAttributeError)r:   rt   rm   r;   rL   ru   s   &     r   ra   Ú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ÃCc                óà  € RR.pR.pV P                    EFU  pW19  g   K  V P                  V,           EF1  pW0P                  8X  d#   V P                  V,          V,          R,          pMV P                  V,          V,          pV FÛ  pVP                  4       pVP	                  R4      R
8w  d   V^ VP	                  R4       pRVP                  4       ,          pV P                  VRR7      p\        V4      ^8X  d6   V^ ,          P                  4       P                  4       V9  d   \        V4      hV^ ,          ^ ,          P                  4       '       d   KÒ  \        V4      h	  EK4  	  EKX  	  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   ÚendmoderO   rK   z#The following option is invalid: %sT)Úinclude_nullNr-   )
r1   r8   r.   rY   r^   Ú_clean_duplicatesr{   r]   r   Úisalpha)	r:   Úsections_whitelistÚoptions_whitelistrN   rM   rO   Úoptionru   Úoptbitss	   &        r   r~   Ú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ó %r   c                ó  € . ROp. p. pVR8X  d#   V P                   V,          V,          R,          pMV P                   V,          V,          pV FÞ  pVP                  4       pVP                  R4      R8w  d   V^ VP                  R4       pV P                  V4      p V^ ,          P	                  4       V9   d   VP                  V^ ,          4       K…  V^ ,          P	                  4       R8X  d>   \        V4      ^8”  d,   V^,          R8w  d    VP                  V^,          4       KÚ  KÜ  KÞ  Kà  	  / p	V F0  pV	P                  V4      R8w  d   VP                  V4       K,  WyV&   K2  	  V#   \        \        3 d     EK1  i ; 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. thoughr   rO   rK   r“   N)ÚdriverÚbusidrL   r-   )
r8   rY   r^   r�   r]   r[   r{   rŠ   Ú
IndexErrorÚget)
r:   rN   rM   Ú	blacklistÚtotalÚ
duplicatesrO   r“   r”   Úfinals
   &&&       r   Úget_duplicate_optionsÚParser.get_duplicate_options  sc  € ò 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*ÃAE*Å*F Å?F c                óî   € / pV P                    Fb  pV P                   V,           FH  pV P                  W#4      p\        V4      ^ 8”  g   K&  VP                  V/ 4      P                  VV4       KJ  	  Kd  	  V# )z5Look for and return duplicate options in all sections)r8   rŸ   r{   r\   )r:   r�   rN   r;   Úduplopts   &    r   Úcheck_duplicate_optionsÚParser.check_duplicate_optionsM  sr   € ð ˆ
Ø—{”{ˆGØŸ™ G×,Ð,�Ø×4Ñ4°WÓC�Ü�w“< !Ö#Ø×)Ñ)¨'°2Ó6×AÑAÀ$ØBIöKó -ñ #ð Ðr   c                óN  € . pRp^ p^ pVP                  R4      pV^ 8”  d­   V F¥  pVP                  4       '       g   VR8X  d   V^,          pMCWH,          pM:V^,          ^ 8w  d
   WH,          pM#\        V4      ^ 8”  d   VP                  V4       RpV\        V4      ^,
          8X  d   VR8w  d   VP                  V4       V^,          pK§  	  MŸV F™  pVP                  4       '       g
   WH,          pM#\        V4      ^ 8”  d   VP                  V4       RpV\        V4      ^,
          8X  d5   VR8w  d   VP                  V4       MV'       d   RpVP                  V4       V^,          pK›  	  V'       d2   \        V4      V^,          ^,           8w  d   RpVP                  V4       V# )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 optionsrJ   rP   )ÚcountÚisspacer{   r[   )	r:   r“   rŽ   r”   Úoptbitrm   Ú	quotationÚoptcountÚis	   &&&      r   r�   ÚParser._clean_duplicatesZ  sd  € ð ˆØˆØˆØˆ	Ø—<‘< Ó$ˆØ�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Ô"àˆr   c                ó<  € / pV P                    F‰  p. pV P                   V,           F  pVP                  V^ ,          4       K  	  V FL  pVP                  V4      ^8”  g   K  VP                  V/ 4      P                  VVP                  V4      4       KN  	  K‹  	  V# )zhReturn a dictionary with the duplicate sections i.e. sections
of the same kind, with the same identifier)r6   r[   r¦   r\   )r:   r�   rN   Útemprt   r;   s   &     r   r|   ÚParser.get_duplicate_sectionsŸ  s“   € ð ˆ
Ø×'Ô'ˆGØˆDØ×(Ñ(¨×1Ð1�Ø—‘˜D �GÖ$ñ 2ã�Ø—:‘:˜dÓ# aÖ'Ø×)Ñ)¨'°2Ó6×AÑAÀ$Ø7;·z±zÀ$Ó7GöIó ñ	 (ð Ðr   c                ó,  € R.pVR8w  d_   V P                   V,          P                  V4      R8X  d   \        hV'       d   V P                  WVVR7       M%V P                  WVR7       MV P                  W4       VR8X  d¿   VR8X  d7   RV,           R,           V,           \	        V4      ,           V,           R,           p	MÒVP                  4       P                  4       V9  d7   RV,           R,           V,           \	        V4      ,           V,           R,           p	MyRV,           R,           \	        V4      ,           R,           p	MQRV,           R,           R,           V,           R,           R,           V,           \	        V4      ,           V,           R,           p	\        V P                   V,          4      ^ 8X  do   / V P                   V&   . V P                   V,          ^ &   WP                  9   d:   RV,           R	,           p
V P                   V,          ^ ,          P                  V
4       VR8X  dF   V P                   V,           F,  pV P                   V,          V,          P                  V	4       K.  	  R# V P                   V,          V,          P                  V	4       R# )
an  Add 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©ÚvaluerM   ry   rS   rT   rP   z	Identifier	"Default z"
)
r8   rš   r   Úremove_optionr}   rY   r]   r{   r3   r[   )r:   rN   r“   r³   Úoption_typerM   Ú	referenceÚprefixÚrefSectionsÚtoaddrL   r;   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°%Ö8r   c                ó  € / p\        V P                  V,          4      ^ 8w  Edh   VR8X  Ed+   V P                  V,           EF  p^ pV P                  V,          V,           Fì  p	VR8w  d‡   V	P                  4       P                  VP                  4       4      R8w  dT   V	P                  4       P                  VP                  4       4      R8w  d"   VP	                  V. 4      P                  V4       MSV	P                  4       P                  VP                  4       4      R8w  d"   VP	                  V. 4      P                  V4       V^,          pKî  	  EK  	  V# V P                  V,          P                  V4      R8X  d   R# ^ pV P                  V,          V,           Fì  p	VR8w  d‡   V	P                  4       P                  VP                  4       4      R8w  dT   V	P                  4       P                  VP                  4       4      R8w  d"   VP	                  V. 4      P                  V4       MSV	P                  4       P                  VP                  4       4      R8w  d"   VP	                  V. 4      P                  V4       V^,          pKî  	  V# )z=Private method shared by remove_option and comment_out_optionNr-   )r{   r8   r]   r^   r\   r[   rš   )
r:   rN   r“   r³   rM   r¶   Ú	to_remover;   rm   rn   s
   &&&&&&    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�šñ !?ð  Ðr   c                ó¸   € V P                  WVWE4      pV F@  p^ pWg,           F/  p	W˜,
          p
V P                  V,          V,          V
 V^,          pK1  	  KB  	  R# )a  Remove 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:   rN   r“   r³   rM   r¶   r½   ÚpartÚmoddedrn   Úrealposs   &&&&&&     r   r´   ÚParser.remove_option&  s_   € ð ×2Ñ2°7ÀEØ2:óGˆ	ãˆDØˆFØ!Ÿ˜�Ø�-�Ø—K‘K Õ(¨Õ.¨wÐ7Ø˜!•’ó (ó r   c                óh  € \        V P                  V,          4      pWP                  9   dþ   VR8w  då   RpRpV P                  V,           Fr  pV P                  WV4      '       g   K   V P                  VVV4      P	                  4       P                  4       VP	                  4       P                  4       8X  d   Rp MKt  	  V'       dN   . V P                  V,          V&   V P                  WVVR7       V P                  V,          P                  W#34       V# \        RV,          4      h. V P                  V,          V&   V#   \         de    T P                  YT4       FI  pTP	                  4       P                  4       TP	                  4       P                  4       8X  g   KD  Rp  EK_  	   EKe  i ; 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{   r8   r3   r‰   rY   r]   rŠ   rº   r6   r[   r   )r:   rN   rL   rM   r“   ÚcreateÚsubr;   s   &&&     r   Úmake_sectionÚParser.make_section9  s’  € ô ˜Ÿ™ 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    Á)AEÅAF1Æ#F1Æ*F1Æ0F1c                óF  € / pV'       d&    V P                  W4      pVP                  VR4       MmVR8w  d,   V P                  WR7      '       d   VP                  VR4       M;\	        V P
                  V,          P                  4       4      p/ P                  V4      pWP                  9   dx   ^ pV P                  V,           F^  p \	        VP                  4       4      P                  V^,          4      p	Wt\	        VP                  4       4      V	,          &   V^,          pK`  	  \	        VP                  4       4      p
V
P                  4        ^ pV
 F—  pV P                  W4      pV F"  p V P
                  V P                  ,          V K$  	  V P!                  W4       V P
                  V,          V WL,          pVR8w  g   Kr  Wû,
          pV P                  V,          V V^,          pK™  	  R#   \         d     EL_i ; i  \         d     Löi ; i  \         d     K¸  i ; i)z/Remove Sections by identifier, position or typeNry   )Úget_positionr\   r   r‚   Úlistr8   Úkeysr5   r3   r6   ÚindexÚ
ValueErrorÚsortÚget_subsectionsr.   r`   Ú_remove_comment_entries)r:   rN   rL   rM   r½   ÚposÚallkeysrm   r¶   ÚrefÚsorted_removerÂ   rt   ÚsubsectionsrÇ   ÚidentrefrÃ   s   &&&&             r   Úremove_sectionÚParser.remove_sectionr  sñ  € ð
 ˆ	ßðØ×'Ñ'¨Ó<�Ø×$Ñ$ 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. ÃAH Å+HÇ.G=Ç<G=È HÈHÈH ÈH c                ó0   € V P                  WVVRR7       R# )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³   rM   r¶   N)rº   ©r:   rN   r¶   rL   rM   s   &&&&&r   Úadd_referenceÚParser.add_referenceµ  s   € ð 	�‰˜°*Ø!)°Tð 	ö 	;r   c                ó0   € V P                  WVVRR7       R# )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Ø$,¸ð 	ö 	>r   c                óÊ  € VR8X  d   V P                   pMVP                  R4       VR Tp/ P                  V4      pV F¶  p. WV&   / p V P                  WVRR7      pV'       g   K(   VP                  R4       VR V F<  p	 V	P                  R4       V	R V	 F  p
V	'       g   K  VP                  V
4       K   	  K>  	  \        VP                  4       4       F  pWV,          P                  V4       K  	  K¸  	  V#   \         d    . p L­i ; i  \         d!    T	'       d   TP                  T	4        K·   Kº  i ; i  \         d    T'       d   TP                  T4        L¤i ; i)a  Get 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).NrJ   T©r¶   r-   )	r3   r[   r5   r‰   r   r\   rŠ   rÌ   rÍ   )r:   rN   rM   rx   rO   r4   r“   Úreference_dictrÕ   r;   Úextrefr¶   s   &&&&        r   r€   Ú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Â9D;Ã:D
Ä	D
ÄD8Ä D8Ä1D;Ä7D8Ä8D;Ä;E"ÅE"Å!E"c                óü  € \        V P                  V P                  ,          4      pVR8X  Ed;   V P                  V,           EF   pRpV P                  V P                  ,           F³  pV P                  V P                  ,          V,          P                  R4      V8X  g   K=  V P                  V P                  ,          V,          P                  R4      V8X  g   Kw  V P                  V P                  ,          V,          P                  R4      V8X  g   K±  RpKµ  	  V'       g   Kä  / ;q€P                  V P                  ,          V&   WR&   W(R&   . VR&   WXR&   ?V^,          pEK#  	  R# RpV P                  V P                  ,           F³  pV P                  V P                  ,          V,          P                  R4      V8X  g   K=  V P                  V P                  ,          V,          P                  R4      V8X  g   Kw  V P                  V P                  ,          V,          P                  R4      V8X  g   K±  RpKµ  	  V'       d6   / ;q€P                  V P                  ,          V&   WR&   W(R&   . VR&   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)NTrN   rL   rM   FrO   )r{   r8   r.   rš   )	r:   rN   rL   rM   rq   r;   rÆ   rÇ   rp   s	   &&&&     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˜*Ñ%Úñ r   c                óÌ  € \        V P                  V P                  ,          4      p. pVR8X  d«   V P                  V P                  ,           Fˆ  pV P                  V P                  ,          V,          P                  R4      V8X  g   K=  V P                  V P                  ,          V,          P                  R4      V8X  g   Kw  VP	                  V4       KŠ  	  MãV P                  V P                  ,           FÂ  pV P                  V P                  ,          V,          P                  R4      V8X  g   K=  V P                  V P                  ,          V,          P                  R4      V8X  g   Kw  V P                  V P                  ,          V,          P                  R4      V8X  g   K±  VP	                  V4       KÄ  	  V F!  pV P                  V P                  ,          V K#  	  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)NrN   rL   rM   )r{   r8   r.   rš   r[   )r:   rN   rL   rM   rq   r½   r;   Úitems   &&&&    r   Úremove_subsectionÚParser.remove_subsectionD  sc  € ô ˜Ÿ™ 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ó r   c                ó	  € Rp. p. p	VR8X  d   V P                  WV4       MV P                  WVVR7       VR8X  d)   RV,           R,           \        V4      ,           R,           p
MQRV,           R,           V,           V,           V,           R,           V,           \        V4      ,           V,           R,           p
\        V P                  V P                  ,          4      pV^ 8X  d'   RVRVR. /V P                  V P                  ,          ^ &   VR8X  Edò   \        V P                  V,          4      p^ pWÜ8  dï   V P                  V P                  ,           FÂ  pV P                  V P                  ,          V,          P                  R	4      V8X  g   K=  V P                  V P                  ,          V,          P                  R4      V8X  g   Kw  V P                  V P                  ,          V,          P                  R4      V8X  g   K±  VP                  V4       KÄ  	  V^,          pKô  \        V^,           4       F  pWø9  g   K  V P                  WVR7       K   	  V P                  V P                  ,           Fˆ  pV P                  V P                  ,          V,          P                  R4      V8X  g   K=  V P                  V P                  ,          V,          P                  R4      V8X  g   Kw  V	P                  V4       KŠ  	  EM<V P                  V P                  ,           Fˆ  pV P                  V P                  ,          V,          P                  R	4      V8X  g   K=  V P                  V P                  ,          V,          P                  R4      V8X  g   Kw  V	P                  V4       KŠ  	  \        V	4      ^ 8X  d„   \        V P                  V P                  ,          4      pRVRVR. R	V/V P                  V P                  ,          \        V P                  V P                  ,          4      &   V	P                  V4       V	 F=  pV P                  V P                  ,          V,          R,          P                  V
4       K?  	  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)rP   Nry   rS   rT   rN   rL   rO   rM   )	Úremove_suboptionr}   r{   r8   r.   rš   r[   Úrangeré   )r:   rN   rL   r“   r³   rµ   rM   r·   Únot_to_createÚ	to_modifyr¹   rq   Úcursect_lengthrm   r;   r«   s   &&&&&&&         r   Úadd_suboptionÚParser.add_suboptiond  sš  € ð$ ˆØˆØˆ	Ø�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ó r   c                óP  € / p\        V P                  V,          4      ^ 8w  Ed   \        V P                  V P                  ,          4      ^ 8w  EdÖ   V P                  V P                  ,           EF³  pV P                  V P                  ,          V,          pVR8X  d¸   VP                  R4      V8X  d¡   VP                  R4      V8X  d‹   ^ pVR,           F{  p	V	P	                  4       P                  4       P                  VP	                  4       P                  4       4      R8w  d"   VP                  V. 4      P                  V4       V^,          pK}  	  MÌVP                  R4      V8X  d·   VP                  R4      V8X  d¡   VP                  R4      V8X  d‹   ^ pVR,           F{  p	V	P	                  4       P                  4       P                  VP	                  4       P                  4       4      R8w  d"   VP                  V. 4      P                  V4       V^,          pK}  	  ?EK¶  	  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()NrN   rL   rO   rM   r-   )	r{   r8   r.   rš   rY   r]   r^   r\   r[   )
r:   rN   rL   r“   rM   r½   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ð, Ðr   c                óØ   € V P                  WW44      pV FQ  p^ pWV,           F@  pW‡,
          p	V P                  V P                  ,          V,          R,          V	 V^,          pKB  	  KS  	  R# )z#Remove an option from a subsection.rO   N)rú   r8   r.   )
r:   rN   rL   r“   rM   r½   r;   rÂ   rÁ   Úreal_poss
   &&&&&     r   rð   ÚParser.remove_suboptionØ  sf   € ð ×5Ñ5°gØ6<óHˆ	ãˆDØˆFØ!Ÿ˜�Ø�=�Ø—K‘K §¡Õ0°Õ6°yÕAÀ(ÐKØ˜!•’ó (ó r   c                ó¾   € RW3,          p V P                   V,           F  pV^,          V8X  g   K  V^ ,          u # 	  \        T4      h  \         d    \        hi ; i)z;Get the identifier of a specific section from its position.z1No identifier can be found for section "%s" No %d)r6   r`   r   r   )r:   rN   rM   Ú	error_msgrt   s   &&&  r   Úget_identifierÚParser.get_identifierä  sk   € ð IØÐ)õ*ˆ	ð	#Ø×(Ñ(¨×1Ð1�Ø˜•7˜hÖ&Ø �7’Nñ 2ô
 " )Ó,Ð,øô ô 	#Ü"Ð"ð	#ús   Œ!A
 ²
A
 ½A
 Á
Ac                ót
  € V'       dw   RVP                  4       P                  4       9   d   R# VP                  4       P                  4       P                  VP                  4       P                  4       4      '       g   R# . pRp^ p^ pVP                  R4      p	V	^ 8”  EdJ   V EFA  p
V	R9   d•   VR8X  dŽ   V
P	                  4       '       ga   V
R8X  dC   V^ 8w  d2   V^,          ^ 8w  d$   \        V4      ^ 8”  d   VP                  V4       RpV^,          pM˜V^,          ^ 8w  d	   Wj,          pM�V^,          ^ 8w  d	   Wj,          pMjV
P	                  4       '       g   V
R8X  d   V^,          pMCWj,          pM:V^,          ^ 8w  d
   Wj,          pM#\        V4      ^ 8”  d   VP                  V4       RpV\        V4      ^,
          8X  d   VR8w  d   VP                  V4       V^,          pEKD  	  MƒV F}  p
V
P	                  4       '       g
   Wj,          pM#\        V4      ^ 8”  d   VP                  V4       RpV\        V4      ^,
          8X  d   VR8w  d   VP                  V4       V^,          pK  	  \        V4      pV^8”  Ed|   V P                   Uu. uF   qÌP                  4       P                  4       NK"  	  ppVR8w  dÎ   V^ 8X  dÇ   V^8X  dÀ   V^ ,          P                  4       P                  4       V9   d–    Rp\        V^,          P                  4       4      pV P                   FM  pV^ ,          P                  4       P                  4       VP                  4       P                  4       8X  g   KK  Tp M	   V P                  Wï4      pV.# V	^8w  dC   VR8w  d<   RpV F*  pVP                  4       VP                  4       8X  g   K(  RpK,  	  VR8X  d   R# V^8X  d-   V^ ,          P                  4       P                  4       R8X  d   R# V P                   Uu. uF   qîP                  4       P                  4       NK"  	  ppV	^8X  ds   VR8X  dl   VP                  4       P                  4       R8X  d   \        V4      ^8X  d   V^ / pV F  pVP                  V4       K  	  \        VP!                  4       4      # V	^ 8”  d   V	^8:  d   W[^,
          ,          # V	^8”  d   V^  V# V	^ 8X  d   V^  R	P#                  V4      # R
# V	R9   d
   VR8X  d   V# R# u upi   \         d     R# i ; i  \         d     EL¨i ; iu upi )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“   FrJ   rP   r$   TÚTrueÚinputdeviceÚ N)é   é   )rY   r]   rZ   r¦   r§   r{   r[   r4   Úintr3   r  r   rÏ   r1   r\   rÌ   rÍ   Újoin)r:   r“   Úoptnamer¶   rN   r”   r¨   rm   r©   rª   r«   ÚoptlenÚxÚreferences_listrt   r³   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°Ô&?Ø�ÙùòI Køô( 0ô %Ú$ð%ûä!ô Úðüò" HsC   Ê&TË5A4T# Í.T# Í5T Ð&T5ÔT ÔT# ÔT Ô T# Ô#T2Ô1T2c                ó`  € . pV P                   V,          P                  V4      R8X  d   \        h V P                   V,          V,          P                  R4       R#   \         Edù    TR8X  d   \        R4      hT P                   T,           EF„  pT P                   T,          T,          P                  R4      T8X  g   K4  T P                   T,          T,          P                  R4      T8X  g   Kd  T P                   T,          T,          P                  R4      T8X  g   K”  T P                   T,          T,          R,           FË  p	TP                  4       P                  4       T	P                  4       P                  4       9   g   KD  T	P                  4       P                  R4      R8w  d2   T	P                  4       ^ T	P                  4       P                  R4       p
MT	P                  4       p
TP                  T P                  T
Y&R	7      4       KÍ  	  EK‡  	  \        T4      ^ 8X  d   \        h\        T4      ^8”  d   Tu #  T^ ,          u #   \         d      R# i ; i\         Ed4    T P                   T,          T,           FË  pTP                  4       P                  4       TP                  4       P                  4       9   g   KD  TP                  4       P                  R4      R8w  d2   TP                  4       ^ TP                  4       P                  R4       p
MTP                  4       p
TP                  T P                  Y¢YaR
7      4       KÍ  	  \        T4      ^ 8X  d   \        h\        T4      ^8”  d   Tu #  T^ ,          u #   \         d      R# i ; i\         d    \        hi ; 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 subsectionsrL   rM   rN   rO   rK   rä   )r¶   rN   r-   )r8   rš   r   rÎ   rŠ   Ú	ExceptionrY   r]   r^   r[   r  r{   r   r™   rÏ   r`   )r:   rN   r“   rM   rL   rt   r¶   Úvaluesr;   rù   Ústropts   &&&&&&&    r   r‰   Ú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-É)AN-ËB3N-Í>N	ÎN-Î	NÎN-ÎNÎN-Î%N-c                óÎ   € VR8w  d    V P                  W4       R# VR8w  d&   V P                  V,          P                  V4      R8g  # Rp\	        V4      h  \         d     R# 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Ë   r   r8   rš   r  )r:   rN   rL   rM   r   s   &&&& r   r‚   ÚParser.is_section#  so   € ð
 ˜ÔðØ×!Ñ! 'Ô6Ùð ˜ÔØ—;‘;˜wÕ'×+Ñ+¨HÓ5¸Ñ=Ð=àHˆIÜ˜IÓ&Ð&øô 'ô Úðús   ‰A ÁA$Á#A$c                ó*  € RV: RV: R2pV P                   V,           FU  p V^ ,          P                  4       P                  4       VP                  4       P                  4       8X  d   V^,          u # KW  	  \	        V4      h  \         d     Kr  i ; i)z;Get the position of a specific section from its identifier.zNo z section named "z" can be found)r6   rY   r]   rŠ   r   )r:   rN   rL   r   rt   s   &&&  r   rË   ÚParser.get_position4  sŠ   � ó ›zð+ˆ	à×$Ñ$ W×-Ð-ˆDðØ˜•7—=‘=“?×(Ñ(Ó*¨j×.>Ñ.>Ó.@×.FÑ.FÓ.HÔHØ �7’Nñ Iñ .ô " )Ó,Ð,øô "ô Úðús   £ABÂBÂBc                ó²  € / P                  V P                  4      p/ pV P                   F@  p/ W#&   / W&   V P                  V,           F  pV P                  VV4      W#,          V&   K   	  KB  	  V Fã  pW#,           FÔ  pW#,          V,           F¾  p\	        W#,          V,          V,          4      ^ 8”  g   K)  W#,          V,          V,           F{  pV P
                   F8  pVP                  4       VP                  4       P                  4       8X  g   K6  TpK:  	  V P                  Wg4      '       d   Kd  W,          P                  V4       K}  	  KÀ  	  KÖ  	  Kå  	  V# )a4  Look 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' {...}
                    })
r5   r3   r8   r€   r{   r1   r]   rY   r‚   r\   )r:   Úbroken_referencesÚreferences_treerN   rt   r;   ÚrefsectrÕ   s   &       r   r   ÚParser.get_broken_referencesA  s1  € ð$ Ÿ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ñ 'ð  !Ð r   c                óä  € . pV P                   R,          p^ pV FÁ  p V P                  RRV4      pV'       dš   ^ pV P                  R,           Fl  pV^ ,          P                  4       P	                  4       VP                  4       P	                  4       8X  g   KK  VP                  V^,          4       V^,          pKn  	  V^ 8X  d   Rp\        V4      hT^,          pKÃ  	  V#   \         d     Li ; 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   )r8   r‰   r6   r]   rY   r[   r   r   )	r:   ÚdefaultÚserverflagsrm   Úflagr…   Údef_itrL   ru   s	   &        r   r�   ÚParser.get_default_serverlayouto  sð   € ð ˆØ—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                ó˜  € VR,           EF%  pVR,          V,          R,          pVR,          V,          R,          pVR,          V,          P                  R4      pVR,          V,          R,          pW,          P                  V. 4      P                  R
V,           R,           R,           4       \        V4      ^ 8”  d>   W,          V,          P                  RRP	                  V4      ,           R	,           4       Kñ  W,          V,          P                  RP	                  V4      R	,           4       EK(  	   VR V#   \
         d     T# i ; i)z<Put SubSections back into the sections to which they belong.r   rN   rL   rM   rO   rP   rT   rS   z	EndSubSection
z	SubSection ")rš   r\   r[   r{   r
  r`   )r:   rp   rt   rN   rL   rM   rO   s   &&     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   Ä5D: Ä:E	ÅE	c           	     óÄ  € \         P                  ! V P                  4      pV P                  V4      pV P	                  V4      p. pRP                  V P                  4      R,           pVP                  V4       V F–  pW`P                  8w  g   K  \        W6,          4      ^ 8”  g   K-  W6,           F]  pVP                  RV,           R,           R,           4       VP                  RP                  W6,          V,          4      R,           4       K_  	  K˜  	  ?\        VR4      '       gT   V'       d   \        VR4      pM\        VR4      pVP                  RP                  V4      4       VP                  4        R
#  VP                  \        \        RP                  V4      R4      4      4       R
#   \          d%    TP                  R	P                  T4      4        R
# i ; i)aq  Write 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.rJ   rT   rP   zEndSection

rH   ÚaÚwzUTF-8r   Nz	Section ")ÚcopyÚdeepcopyr8   Ú_merge_commented_optionsr*  r
  r7   r[   r/   r{   rU   rV   rH   rX   r}   ÚbytesÚ	TypeError)r:   ÚdestinationÚtestrp   Úlinesr7   rN   r;   s   &&&     r   rH   Ú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ÇGc                ó<  € . pV P                   V P                  ,           Fx  pV P                   V P                  ,          V,          R,          V8X  g   K5  V P                   V P                  ,          V,          R,          V8X  g   Kg  VP                  V4       Kz  	  V# )z.Get all the subsections contained in a sectionrN   rM   )r8   r.   r[   )r:   rN   rM   r×   rÇ   s   &&&  r   rÑ   ÚParser.get_subsectionsÖ  sw   € ð ˆØ—;‘;˜tŸ™×/Ð/ˆCØ—‘˜DŸO™OÕ,¨SÕ1°)Õ<ÀÖGØ—K‘K §¡Õ0°Õ5°jÕAÀXÖMØ×"Ñ" 3Ö'ñ 0ð
 Ðr   c                óô  € V EF]  pV P                   V P                  ,          V,          R,          pV P                   V P                  ,          V,          R,          pV P                   V P                  ,          V,          P                  R4      pV P                   V P                  ,          V,          R,          pV P                  P	                  R
V,           R,           R,           4       V FP  pRVP                  4       ,          pV P                  P	                  V4       V P                  P	                  R4       KR  	   V P                   V P                  ,          V EK`  	  R	#   \         d     EKs  i ; i)a  Put 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
removerN   rL   rM   rO   rP   rT   ú#		%s
ú#	EndSubSection
Nz#	SubSection ")r8   r.   rš   r7   r[   rY   r`   )	r:   r×   rt   rN   rL   rM   rO   r“   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Å6E7c                óh  € . pV P                   V P                  ,          P                  V4      '       d~   V P                   V P                  ,          V,           FU  pV P                   V P                  ,          V,          V,          P                  R4      V8X  g   KD  VP                  V4       KW  	  V# )zBReturn the index of the entry in the Comments section of a sectionrM   )r8   r/   rš   r[   )r:   rN   rM   r7   rt   s   &&&  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ð
 ˆr   c                ó  € RpV EF  pV P                   V P                  ,          V,          R,          pV P                   V P                  ,          V,          R,          pV P                   V P                  ,          V,          P                  R4      pV P                   V P                  ,          V,          R,          pRV,          pV P                  WF4      p	V	'       g‡   / V P                   V P                  ,          V&   / V P                   V P                  ,          V,          V&   V P                   V P                  ,          V,          V,          p
RV
R&   WjR&   RV
R&   . V
R&   ?
V P                   V P                  ,          V,          V,          R,          pVP                  V4       V F+  pRVP                  4       ,          pVP                  V4       K-  	  VP                  V4       V P                   V P                  ,          V EK  	  R# )	a3  Put 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<  rN   rL   rM   rO   z#	SubSection "%s"
Nr;  )r8   r.   rš   r@  r/   r[   rY   )r:   r×   Úend_subsectionrt   rN   rL   rM   rO   Ústart_subsectionr7   rp   Ú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ó=  r   c                óJ   € V P                  W4      pV P                  V4       R# )z-Comment out all the subsections of a section.N)rÑ   r=  )r:   rN   rM   r×   s   &&& r   Ú_comment_out_subsectionsÚParser._comment_out_subsections6  s"   € ð ×*Ñ*¨7Ó=ˆØ×)Ñ)¨+Ö6r   c                ó„   € V P                  W4      pV F(  pV P                  V P                  ,          V,          V K*  	  R# )zBRemove comment sections of a "section" from the "Comments" sectionN)r@  r8   r/   )r:   rN   rM   r7   Úcomment_sections   &&&  r   rÒ   ÚParser._remove_comment_entries<  s:   € ð ×%Ñ% gÓ8ˆÛ'ˆOØ—‘˜D×/Ñ/Õ0°Õ9¸/ÒJó  (r   c                óþ  € RV,          pRp/ pV'       d&    V P                  W4      pVP                  VR4       MmVR8w  d,   V P                  WR7      '       d   VP                  VR4       M;\	        V P
                  V,          P                  4       4      p/ P                  V4      pWP                  9   dx   ^ p	V P                  V,           F^  p
 \	        VP                  4       4      P                  V
^,          4      pW–\	        VP                  4       4      V,          &   V	^,          p	K`  	  \	        VP                  4       4      pVP                  4        ^ pV Fù  pV P                  P                  V4       V P
                  V,          V,           F5  pRVP                  4       ,          pV P                  P                  V4       K7  	  V P!                  W4       V P                  P                  V4       V P#                  W4       V P
                  V,          V Wn,          pVR8w  g   KÓ  VV,
          pV P                  V,          V V^,          pKû  	  R#   \         d     ELÁi ; i  \         d     ELYi ; i)z.Comment out a section and all its subsections.z
#Section "%s"
z#EndSection
Nry   z#	%s
)rË   r\   r   r‚   rÌ   r8   rÍ   r5   r3   r6   rÎ   rÏ   rÐ   r7   r[   rY   rI  rÒ   )r:   rN   rL   rM   Ústart_sectionÚend_sectionr½   rÓ   Úall_keysrm   r¶   rÕ   rÖ   rÂ   rt   r“   Úcommented_optionÚ	ident_refrÃ   s   &&&&               r   Úcomment_out_sectionÚParser.comment_out_sectionC  s.  € ð ,¨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 ÃAI-ÉI*É)I*É-I<É;I<c                ó8  € . pV P                   V P                  ,           Fe  pV P                   V P                  ,          V,          pVR,          V8X  d0   VR,          V8X  d"   VR,          V8X  d   VP                  V4        M?Kg  	  V P                  V4       R# )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 sectionrN   rL   rM   N)r8   r.   r[   rF  )r:   rN   rL   rM   r×   r.   rp   s   &&&&   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Ö:r   c                ó¾  € V P                  WVWE4      pV EFÂ  p^ pWg,           EF¯  p	W˜,
          p
RV P                  V,          V,          V
,          P                  4       ,          V P                  V,          V,          V
&   V P                  V P                  ,          P	                  V/ 4       \        V P                  V P                  ,          V,          4      pV P                  V P                  ,          V,          pVP	                  V/ 4       WÇ,          P	                  RR4       WÇ,          P	                  RV4       WÇ,          P	                  RR4       WÇ,          P	                  R. 4       WÇ,          R,          P                  V P                  V,          V,          V
,          4       ?V P                  V,          V,          V
 V^,          pEK²  	  EKÅ  	  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)ú#%srL   NrM   rN   rO   )r¾   r8   rY   r/   r\   r{   r[   )r:   rN   r“   r³   rM   r¶   r½   rÁ   rÂ   rn   rÃ   rq   rp   s   &&&&&&       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à˜!•“ô+ (ó r   c                ó  € V P                  WW44      pV EFñ  p^ pWV,           EFÞ  pW‡,
          p	RV P                  V P                  ,          V,          R,          V	,          P                  4       ,          V P                  V P                  ,          V,          R,          V	&   V P                  V P                  ,          P                  V P                  / 4       V P                  V P                  ,          V P                  ,          p
V
P                  V/ 4       W¨,          P                  RV4       W¨,          P                  RV4       W¨,          P                  RV4       W¨,          P                  R. 4       W¨,          R,          pV P                  V P                  ,          V,          R,          V	,          pVP                  V4       ?
V P                  V P                  ,          V,          R,          V	 V^,          pEKá  	  EKô  	  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)rZ  rO   rL   rM   rN   N)rú   r8   r.   rY   r/   r\   r[   )r:   rN   rL   r“   rM   r½   r;   rÂ   rÁ   rÃ   rp   rE  rR  s   &&&&&        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 (ó r   c                óê  € WP                   ,           EFÛ  pRpWP                   ,          V,           EFH  pWP                   ,          V,          V,          P                  R4      pWP                   ,          V,          V,          P                  R4      pWP                   ,          V,          V,          P                  R4      pWP                   ,          V,          V,          R,          pWPP                  8X  dj   W,           FZ  p	W,          V	,          p
V
R,          V8X  g   K"  V
R,          V8X  g   K2  V
R,          V8X  g   KB  W,          V	,          R,          p EK,  	  EK1  W,          P                  V4      pEKK  	  V'       g   EKw  X F^  pRVP                  4       ,          pW P                  8X  d$   VP	                  R. 4      P                  V4       KM  VP                  V4       K`  	  EKÞ  	  V# )zAPut commented out options back into their sections or subsectionsNrN   rL   rM   rO   z	%s
)r/   rš   r.   rY   r\   r[   )r:   rp   rt   Úsection_optionsÚsection_instancerN   rL   rM   rO   rÇ   r.   r“   s   &&          r   r1  Ú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   )
r8   r7   r/   r6   r4   r3   r1   r0   r.   r2   r?   )NNNrP   )NNN)NN)5r   r   r   r   r   r<   rA   rE   ÚpropertyÚ
globaldictr9   rb   ra   r~   rŸ   r£   r�   r|   rº   r¾   r´   rÈ   rÙ   rÞ   rá   r€   ré   rí   rõ   rú   rð   r  r  r‰   r‚   rË   r   r�   r*  rH   rÑ   r=  r@  rF  rI  rÒ   rT  rW  r[  r^  r1  r   Ú__classdictcell__)Ú__classdict__s   @r   r   r   *   s  ø‡ € ñ@ôNò`ò"ñ ˜+ {Ó3€JòT%òll,ò\-ò^"8òH-ò^ôCòJô"F9ôP,ô\ô&7ôr@ôF;ô$>ô$1ôf6ôp3ô@NHôb ôF
ò-ô\ô|Q&ôf'ò"-ò+!ò\ò>ô8*3òX
òò8
ò*3òX7òKôEòP;ô($ôN(÷V"ð "r   r   )Ú
__future__r   r   Úsysr   r   r/  r  r   r   r   r   Úobjectr   r	   r   r   Ú<module>rk     sT   ðõ( &Ý 'Û 
ß Û ô	˜)ô 	ô	�iô 	ô	�yô 	ô	�Yô 	ôiˆVö ir   