+
    G%@i3                     h    ^ RI Ht ^ RIHt R tR t ! R R4      t ! R R]4      t ! R	 R
4      tR# )    )Action)ConfigParserc                H    \        V 4      pV\        J ;'       g	    V\        J # )z@Return true if val is an instance of a known sequence type.
    )typelisttuple)valval_types   & -/usr/lib/python3/dist-packages/sos/options.py_is_seqr      s%     CyHt00x500    c                 J    V P                  4       pVR9   d   R# VR9   d   R# R# )trueTFN)r   onyes)falseoffno)lower)r	   _vals   & r   str_to_boolr      s(    99;D$$%%r   c                      a  ] tR t^t o R tR tRR ltR tR t/ 3R lt	]
/ 3R l4       t]
R 4       tR	 tR
 tRR ltRR ltR tRtV tR# )
SoSOptionsc                   R  p\        W!4      '       d   \        W!4      p\        W4      pV! V4      '       d   V! V4      '       d2   V'       g*   WP                  9  d   \        V4      '       d	   V'       dO   \	        WV4       V'       d   V P                  P                  V4       R# V P                  P                  V4       R# \        V4      '       d   \	        WWg,           4       R# R# R# )c                 $    V R 8H  ;'       g    V RJ # ) N )r	   s   &r   _unset%SoSOptions._merge_opt.<locals>._unset    s    2I,,-r   N)hasattrgetattr_nondefaultr   setattrdiscardadd)selfoptsrc
is_default
prefer_newr   newvalueoldvalues   &&&&&   r   
_merge_optSoSOptions._merge_opt   s    	. 3s(Ht)H x  )9)9,,,wx7H7H8,$$,,S1$$((-""8#67 #% r   c                    \        V\        4      '       g   \        V4      pV P                   F  pV P	                  WAW#4       K  	  R # N)
isinstancedictvars	arg_namesr-   )r&   r(   r)   r*   args   &&&& r   _merge_optsSoSOptions._merge_opts9   s4    #t$$s)C>>COOCj= "r   c                   TpRpV P                    F  pWWV,           V,           ,          pK  	  VP                  V4       V P                    Uu. uF  p\        W4      NK  	  ppV'       g5   V U	u. uF'  p	\        V	4      '       d   RP	                  V	4      MT	NK)  	  pp	M-V U	u. uF!  p	\        V	\        4      '       d   RV	 R2MT	NK#  	  pp	V\        V4      ,          P                  V4      V,           # u upi u up	i u up	i )a  Format a SoSOptions object as a human or machine readable string.

:param quote: quote option values
:param sep: list separator string
:param prefix: arbitrary prefix string
:param suffix: arbitrary suffix string
:param literal: print values as Python literals
z=%s,')r4   stripr!   r   joinr1   strr   )
r&   quotesepprefixsuffixargsarg_fmtr5   valsvs
   &&&&&     r   __strSoSOptions.__str?   s     >>C'MC''D "

3.2nn=ns"n=>BCd71::CHHQK14dDCD DHH4a
1c 2 2as!H94DHuT{"))#.77 > D Is   C4/-C9#'C>c                "    V P                  4       # r0   _SoSOptions__strr&   s   &r   __str__SoSOptions.__str__X   s    zz|r   c                ,    V P                  R RRRR7      # )Tz, zSoSOptions())r>   r?   r@   rA   rI   rK   s   &r   __repr__SoSOptions.__repr__[   s!    zz$}!$  & 	&r   c                L   Wn         \        VP                  4       4      V n        \	        4       V n        V P                    F   p\        WV P                   V,          4       K"  	  VP                  4        F,  w  r4V P                  P                  V4       \        WV4       K.  	  R# )a  Initialise a new ``SoSOptions`` object from keyword arguments.

Initialises the new object with values taken from keyword
arguments matching the names of ``SoSOptions`` attributes.

A ``ValueError`` is raised is any of the supplied keyword
arguments does not correspond to a known ``SoSOptions`
attribute name.

:param *kwargs: a list of ``SoSOptions`` keyword args.
:returns: the new ``SoSOptions`` object.
N)	arg_defaultsr   keysr4   setr"   r#   itemsappend)r&   rS   kwargsr5   kwargs   &&,  r   __init__SoSOptions.__init___   s~     )l//125$$CDt0056 % !,,.JCNN!!#&Du% )r   c                \    \        R/ \        V4      BRV/B pVP                  VRR4       V# )zInitialise a new SoSOptions object from a ``Namespace``
obtained by parsing command line arguments.

:param args: parsed command line arguments
:returns: an initialised SoSOptions object
:returntype: SoSOptions
rS   TFr   )r   r3   r6   )clsrB   rS   optss   &&& r   	from_argsSoSOptions.from_argsw   s1     BDJB\BtU+r   c                    RpRpW9   d   RV 2.# W9   d)   \        ^ \        V4      4       Uu. uF  pRV 2NK
  	  up# RV RV 2.# u upi )zConvert a named option and optional value to command line
argument notation, correctly handling options that take
no value or that have special representations (e.g. verify
and verbose).
--=)
alloptionszallow-system-changeszall-logsbatchbuilddebugexperimentalzlist-pluginszlist-presetszlist-profilesz	no-reportzno-env-varsquietverify)verbose)rangeint)r]   r'   r	   no_valuecountds   &&&   r   _opt_to_argsSoSOptions._opt_to_args   sk    

 ?J<<(-aS(:;(:1bJ(:;;SE3% !! <s   Ac                   \        V P                  V,          \        V4      4      '       d   V# \        V P                  V,          \        4      '       d   \        VP	                  R4      4      # \        V P                  V,          \
        4      '       d$   \        V4      pVf   \        RV RV R24      hV# \        V P                  V,          \        4      '       d   \        V4      # V# )an  Ensure that the value read from a config file is the proper type
for consumption by the component, as defined by arg_defaults.

Params:
    :param key:         The key in arg_defaults we need to match the
                        type of
    :param val:         The value to be converted to a particular type
    :param conf:        File values are being loaded from
r9   z
Value of 'z' in z# must be True or False or analagous)	r1   rS   r   r   splitboolr   	Exceptionrm   )r&   keyr	   confs   &&&&r   _convert_to_typeSoSOptions._convert_to_type   s     d'',d3i88Jd'',d33		#''d'',d33c"C{ U4& 1   ! ! Jd'',c22s8O
r   c                  a a VV 3R lp\        4       p \        SRR7      ;_uu_ 4       pVP                  VS4       RRR4       T! RT4       T! Y$4       TP                  R4      '       d   \        S R	4      '       d   \        S R
4      '       do   TP                  R4       FW  w  rxTP                  R4      ^ ,          S P                  9   d   K.  S P                  P                  TR,           T,           4       KY  	  R# R# R# R#   + '       g   i     L; i  \         d.   p\	        RS RTP
                  ^,           24        Rp?ELRp?ii ; i)zRead the provided config_file and update options from that.

Positional arguments:

    :param config_file:             Filepath to the config file
    :param component:               Which component (section) to load
c                   < VP                  V 4      '       Ed@   \        VP                  V 4      4      pR VP                  4       9   d   \	        VP                  R 4      4      VR&   RRRRRR/p\        V4       FO  pRV9   d$   VP                  V4      W$P                  RR	4      &   WC9   g   K5  VP                  V4      W#V,          &   KQ  	  VP                  4        Fw  w  rE\        V\        4      '       d   VR
8w  d   VP                  RR4      pVSP                  9  d   \        RV RV  R24       KY  SP                  WES4      p\        SWE4       Ky  	  R# R# )rk   	verbositynamelabelplugin_optionplugoptsprofileprofiles-_keywords r   zUnknown option 'z' in section 'r:   N)has_sectionr2   rV   rT   rm   popr   replacer1   r=   rS   printry   r#   )sectionconfigodictrename_optsrw   r	   config_filer&   s   &&    r   _update_from_section9SoSOptions.update_from_conf.<locals>._update_from_section   s8   !!'**V\\'23

,),UYYy-A)BE+&
 G#Zz
  ;Ccz7<yy~kk#s34)27))C.#./	 ' !&HC "#s++z0A!kk#r2$"3"33  0^G9ANO //+FCD#+ !.' +r   zutf-8)encodingNz+WARNING: Unable to read configuration file z : globalplugin_optionsr   skip_plugins.rc   )r   open	read_fileOSErrorr   rB   r   r    rV   rt   r   r   rW   )	r&   r   	componentr   r   ferw   r	   s	   ff&      r   update_from_confSoSOptions.update_from_conf   s    	,D 	kG44  K0 5 	Xv.Y/.//GD*4M4MD.11"LL)9:yy~a(D,=,==MM((sS9 ; 2 5N/ 54 	=k]#66!9+ 	s3   D DD D	D D E#"EEc                    V P                    FA  p\        W4      '       g   K  \        W4      f   V'       d   K-  V P                  WARVR7       KC  	  R# )aT  Merge another set of ``SoSOptions`` into this object.

Merge two ``SoSOptions`` objects by setting unset or default
values to their value in the ``src`` object.

:param src: the ``SoSOptions`` object to copy from
:param is_default: ``True`` if new default values are to be set.
:param prefer_new: ``False`` if new default is not preferred.
NF)r*   )r4   r    r!   r-   )r&   r(   skip_defaultr*   r5   s   &&&& r   mergeSoSOptions.merge   sA     >>C3$$s ,LL%JG	 "r   c                p    / pV P                    F#  p\        W4      pV'       d
   VR9   d   RpWBV&   K%  	  V# )zReturn this ``SoSOptions`` option values as a dictionary of
argument name to value mappings.

:returns: a name:value dictionary of option values.
N
add_preset
del_presetdescnote)r4   r!   )r&   preset_filterr   r5   values   &&   r   r2   SoSOptions.dict   s@     >>CD&EFF E#J " r   c                   a a V 3R loV3R lpR p\        S P                  4       P                  4       R R7      pV UUu. uF  w  rEV! WE4      '       g   K  V! WE4      NK  	  upp# u uppi )zReturn command arguments for this object.

Return a list of the non-default options of this ``SoSOptions``
object in ``sos report`` command line argument notation:

    ``["--all-logs", "-vvv"]``

c                   < RpV'       d   W9   d   R# V R8X  d   V'       d   R# V SP                   9   d-   \        V4      \        SP                   V ,          4      8X  d   R# R# )z-Test for non-null option values.
            Fr   T)FalseNonez[]z""z''0)rS   r=   )r~   r   null_valuesr&   s   && r   	has_value%SoSOptions.to_args.<locals>.has_value  sS     CKE0z!et(((u:T%6%6t%<!== r   c                F   < V R9   d   R# V R9   d
   V^ 8X  d   R# S! W4      # )z7Filter out preset and null-valued options.
            FTr   )log_sizeplugin_timeoutcmd_timeoutr   )r~   r   r   s   &&r   
filter_opt&SoSOptions.to_args.<locals>.filter_opt$  s/     CCDDA:T))r   c                >   V P                  R4      '       d   R\        V4      R,          ,           pV# V P                  RR4      p \        V4      '       d   RP	                  V4      MTpVRJd	   V  RV 2pMT p\        V4      ^8  d   RV,           pV# RV,           pV# )	zCConvert sos option notation to command line arguments.
            r}   r   rE   r   r9   Tr   rb   )
startswithrm   r   r   r<   len)r~   r   r5   r'   s   &&  r   argify"SoSOptions.to_args.<locals>.argify/  s     {++CJ,,
<<S)D'.u~~CHHUO5ED aw' #C1$*CJ 36)CJr   c                     V ^ ,          # )r   r   )xs   &r   <lambda>$SoSOptions.to_args.<locals>.<lambda>C  s    adr   )rw   )sortedr2   rV   )r&   r   r   	opt_itemsnrE   r   s   f     @r   to_argsSoSOptions.to_args  sV    			*	( 499;,,.NC	+4I9!
18Hq9IIIs   A(A()r"   rS   r4   N)Fr   r   r   )TF)T)__name__
__module____qualname____firstlineno__r-   r6   rJ   rL   rP   rZ   classmethodr_   rq   ry   r   r   r2   r   __static_attributes____classdictcell____classdict__s   @r   r   r      su     84>82& %' &0 *, 
 
 " "$2<:|H  6J 6Jr   r   c                   .   a  ] tR tRt o RtRR ltRtV tR# )SosListOptioniG  z0Allow to specify comma delimited list of pluginsNc                    \        VP                  R 4      4      p\        W P                  4      '       d   V\        W P                  4      ,          p\	        W P                  V4       R# )r9   N)r   rt   r!   destr#   )r&   parser	namespacevaluesoption_stringrV   s   &&&&& r   __call__SosListOption.__call__K  sE    V\\#&'9ii((WY		22E	99e,r   r   r0   )r   r   r   r   __doc__r   r   r   r   s   @r   r   r   G  s     :- -r   r   c                   .   a  ] tR tRt o RtRR ltRtV tR# )ClusterOptioniR  z6Used to store/manipulate options for cluster profiles.Nc                B    Wn         W n        W0n        W@n        WPn        R # r0   )r~   r   opt_typeclusterdescription)r&   r~   r   r   r   r   s   &&&&&&r   rZ   ClusterOption.__init__U  s    	
 &r   )r   r   r~   r   r   r0   )r   r   r   r   r   rZ   r   r   r   s   @r   r   r   R  s     @' 'r   r   N)	argparser   configparserr   r   r   r   r   r   r   r   r   <module>r      s<     %1gJ gJT	-F -' 'r   