+
    4Ssi<                         ^ RI t ^ RIt^ RIt^ RIHtHt ^ RIHt ^ RIH	t	 ^ RI
HtHt  ! R R]4      t ! R R	]4      t ! R
 R]4      t ! R R]4      tR# )    N)Element
SubElement)ConfigParser)StringIO)GPParserENTITY_USER_IDc                   T   a  ] tR t^ t o RtR tR tR tR tR t	R t
R tR	 tR
tV tR# )GPIniParserNc                    \        \        P                  R R7      V n        \        V P                  n        V P                  P                  \        VP                  V P                  4      4      4       R # )N	dict_typeinterpolation)
r   collectionsOrderedDictini_confstroptionxform	read_filer   decodeencoding)selfcontentss   &&7/usr/lib/python3/dist-packages/samba/gp_parse/gp_ini.pyparseGPIniParser.parse#   sI    ${/F/F379$'!)G HI    c                f    \        VR 4      p\        VR4      p\        VR4      pW6n        WGn        V# )	ParameterKeyValue)r   text)r   section_xmlsectionkey_inival_inichildkeyvalues   &&&&&   r   build_xml_parameterGPIniParser.build_xml_parameter+   s5    ;4&5'*
r   c                    VP                  R 4      P                  pVP                  R4      P                  pVf   RpV P                  P                  W#V4       W43# )r   r     )findr!   r   set)r   	param_xmlr#   r'   r(   s   &&&  r   load_xml_parameterGPIniParser.load_xml_parameter4   sP    nnU#((w',,=E'.|r   c                :    \        VR 4      pW#P                  R&   V# )Sectionname)r   attrib)r   root_xmlsec_inir#   s   &&& r   build_xml_sectionGPIniParser.build_xml_section=   s    Xy1!(vr   c                b    VP                   R ,          pV P                  P                  V4       V# )r4   r5   r   add_section)r   r"   section_names   && r   load_xml_sectionGPIniParser.load_xml_sectionC   s*    "))&1!!,/r   c           
     v   \        VR 4      ;_uu_ 4       p\        R4      pV P                  P                  4        FM  pV P	                  W44      pV P                  P                  VRR7       F  w  rgV P                  WTVV4       K  	  KO  	  V P                  W24       RRR4       R#   + '       g   i     R# ; i)wbIniFileT)rawN)openr   r   sectionsr8   itemsr)   write_pretty_xml)r   filenamefrootr7   r#   r$   r%   s   &&      r   	write_xmlGPIniParser.write_xmlI   s    (D!!Q9%D==11300?(,(;(;G(;(N$G,,Ww-46 )O 4 !!$* "!!!s   BB''B8	c                   \        \        P                  R R7      V n        \        V P                  n        VP                  R4       F=  pV P                  V4      pVP                  R4       F  pV P                  WC4       K  	  K?  	  R # )Nr   r3   r   )	r   r   r   r   r   r   findallr>   r0   )r   rJ   sr=   params   &&   r   load_xmlGPIniParser.load_xmlZ   si    ${/F/F379$'!i(A003L;/''< 0 )r   c                    \         P                  ! VR V P                  4      ;_uu_ 4       pV P                  P	                  V4       RRR4       R#   + '       g   i     R# ; i)zwb+N)codecsrD   r   r   write)r   rH   rI   s   && r   write_binaryGPIniParser.write_binaryf   s<    [[5$--88AMM" 9888s   AA"	r   )__name__
__module____qualname____firstlineno__r   r   r)   r0   r8   r>   rK   rQ   rV   __static_attributes____classdictcell__)__classdict__s   @r   r
   r
       s8     HJ+"
=# #r   r
   c                   6   a a ] tR t^kt oRtV 3R ltRtVtV ;t# )GPTIniParserzutf-8c                  <  \         SV `  V4       R #   \         dm    \        \        P
                  R R7      T n        \        T P                  n        T P                  P                  \        TP                  R4      4      4        R # i ; i)Nr   z
iso-8859-1)superr   UnicodeDecodeErrorr   r   r   r   r   r   r   r   r   )r   r   	__class__s   &&r   r   GPTIniParser.parsen   sk    		MGM(#! 	M(;3J3J7;=DM(+DMM% MM##HX__\-J$KL	Ms    A3B
BrX   )	rY   rZ   r[   r\   r   r   r]   r^   __classcell__re   r_   s   @@r   ra   ra   k   s     H
M 
Mr   ra   c                   2   a a ] tR t^{t oV 3R ltRtVtV ;t# )GPScriptsIniParserc                   < \         SV `  WW44      p\        P                  ! R V4      pVe!   VP	                  R4      pRVP
                  R&   V# )z\d+CmdLine$r    TRUEnetwork_path)rc   r)   rematchr-   r5   )	r   r"   r#   r$   r%   parent_returncmdliner(   re   s	   &&&&&   r   r)   &GPScriptsIniParser.build_xml_parameter|   sT    3K4;F ((>73!&&w/E+1ELL(r    )rY   rZ   r[   r\   r)   r]   r^   rg   rh   s   @@r   rj   rj   {   s     	 	r   rj   c                   P   a a ] tR t^t oV 3R ltV 3R ltR tR tR tRt	Vt
V ;t# )GPFDeploy1IniParserc                  < \         S
V `  WW44      pVP                  4       R 8X  d}   VP                  R4      pVP	                  V4       VP                  4       P                  R4      P                  R4      pV F$  p\        VR4      p	Wn        RV	P                  R&   K&  	  V# VR8X  d!   VP                  R4      pRVP                  R&   V# )folder_redirectionr    ;rl   user_idFullPathrm   )
rc   r)   lowerr-   removestripsplitr   r!   r5   )r   r"   r#   r$   r%   rp   r'   sid_listsidr(   re   s   &&&&&     r   r)   'GPFDeploy1IniParser.build_xml_parameter   s    3K4;F ==?22
  $$W-C  %}},,S177<H"=': 
*0Y'   	 *$#((1-3

>*r   c                  < VP                  4       R 8X  d   VP                  R4      P                  pVP                  R4      p\	        V4      ^8X  d   V^ ,          P                  R,           pM*RP                  V Uu. uF  qfP                  NK  	  up4      pV P                  P                  W#V4       W53# \        SV `%  W4      # u upi )rw   r   r    rx   )
r{   r-   r!   rN   lenjoinr   r.   rc   r0   )r   r/   r#   r'   valuesr(   xre   s   &&&    r   r0   &GPFDeploy1IniParser.load_xml_parameter   s    ==?22..',,C&&w/F6{a q	,&!9&Q&&&!9:MMgE2< w))== ":s   =Cc                    \        VR 4      pVP                  4       R8w  dG   VP                  4       R8w  d2   VP                  R4      w  rEWCP                  R&   WSP                  R&   V# W#P                  R&   V# )r3   rw   version_fdeploy_GUIDfdeploy_SIDr4   )r   r{   r~   r5   )r   r6   r7   r#   guidr   s   &&&   r   r8   %GPFDeploy1IniParser.build_xml_section   sm    Xy1MMO33MMOy(c*ID-1NN>*,/NN=)  &-NN6"r   c                    R VP                   9   d   VP                   R ,          pM6VP                   R,          pVP                   R,          pVR,           V,           pV P                  P                  V4       V# )r4   r   r   r   r;   )r   r"   r=   r   r   s   &&   r   r>   $GPFDeploy1IniParser.load_xml_section   sf    ['''&--f5L%%n5D$$]3C#:+L!!,/r   c                :   . pVP                  R 4      pVP                  R R7       V Fn  pVP                  R,          pWb9   d
   W&,          pM;V P                  V\        4      pVP                  Wv34       VP                  Wg3.4       WuP                  R&   Kp  	  V# )z.//Section[@fdeploy_SID]c                     V P                   # )N)tag)r   s   &r   <lambda>5GPFDeploy1IniParser.custom_entities.<locals>.<lambda>   s    !%%r   )r'   r   )rN   sortr5   new_xml_entityr   appendupdate)r   rJ   global_entitiesentitiesfdeploy_sidsr   
old_attrib
new_attribs   &&&     r   custom_entities#GPFDeploy1IniParser.custom_entities   s    ||$>?0CM2J,,8
!00^L
 89&&(@'AB(2JJ}%   r   rs   )rY   rZ   r[   r\   r)   r0   r8   r>   r   r]   r^   rg   rh   s   @@r   ru   ru      s#     8>(
 r   ru   )rT   r   rn   xml.etree.ElementTreer   r   configparserr   ior   samba.gp_parser   r   r
   ra   rj   ru   rs   r   r   <module>r      sS   (   	 5 %  3H#( H#VM; M 
 
\+ \r   