Viewing File: /usr/lib/python2.7/site-packages/sos/__init__.pyo

ó
ÑKjc.@s†dZddlZddlZddlmZejrVddlmZmZm	Z	nddlmZmZm	Z	dZ
dZdZej
eeƒd„ZeZd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6g.Zid7d6d7d6d8d6d7d(6d9d56d7d46Zd:„Zd;efd<„ƒYZdS(=su
This module houses the i18n setup and message function. The default is to use
gettext to internationalize messages.
iÿÿÿÿN(tArgumentParser(tConfigParsertParsingErrortErrors3.9s/usr/share/localetsoscCstjt|ƒS(N(tgettexttdgettexttgettext_app(tmsg((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt_default$st
add_presett
alloptionstallow_system_changestall_logstbatchtbuildtcase_idtchroottcompression_typetconfig_filetdesctdebugt
del_presettdry_runt
enablepluginstencrypt_keytencrypt_passtexperimentaltlabeltlist_pluginstlist_presetst
list_profilestlog_sizet	nopluginstnoreporttno_env_varstno_postproctnotetonlypluginstplugin_timeouttplugoptstpresettprofilestquiettsincetsysroottthreadsttmp_dirtuploadt
upload_urltupload_directorytupload_usertupload_passtupload_protocolt	verbositytverifytautoiicCs"t|ƒ}|tkp!|tkS(s@Return true if val is an instance of a known sequence type.
    (ttypetlistttuple(tvaltval_type((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt_is_seqMst
SoSOptionscBs˜eZd„Zd„Zedddd„Zd„Zd„Zd„Ze	d„ƒZ
e	d	„ƒZe	ed
„ƒZ
ed„Zd„Zd
„ZRS(c	Cs×d„}t||ƒrÓt||ƒ}t||ƒ}||ƒrO||ƒsq|sq||jkr­t|ƒr­t|||ƒ|rš|jj|ƒqÐ|jj|ƒqÓt|ƒrÓt||||ƒqÓndS(NcSs|dkp|dkS(Nt(tNone(R<((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt_unsetWs(thasattrtgetattrt_nondefaultR>tsetattrtdiscardtadd(tselftopttsrct
is_defaultRBtnewvaluetoldvalue((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt
_merge_optVs	cCs(x!tD]}|j|||ƒqWdS(N(t
_arg_namesRO(RIRKRLtarg((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt_merge_optsns
t R@cCsî|}d}x tD]}||||7}qW|j|ƒgtD]}t||ƒ^qC}|s›g|D]'}	t|	ƒrŒdj|	ƒn|	^qk}n8d„}
g|D]"}	|
|	ƒrÇd|	n|	^q«}|t|ƒj|ƒ|S(sIFormat 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
        s=%st,cSst|tjƒS(N(t
isinstancetsixtstring_types(R<((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt	is_string†ss'%s'(RPtstripRDR>tjoinR;(RItquotetseptprefixtsuffixtargstarg_fmtRQtvalstvRX((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt__strrs	

"7	/cCs
|jƒS(N(t_SoSOptions__str(RI((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt__str__sc	Cs"|jdtddddddƒS(NR[R\s, R]sSoSOptions(R^t)(RdtTrue(RI((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt__repr__scKsd|_t|_t|_d|_t|_t|_d|_t	d|_
t	d|_d|_t|_
d|_d|_t|_g|_d|_d|_t|_d|_t|_t|_t|_t	d|_g|_t|_t|_t|_t|_d|_g|_ d|_!g|_"t	d|_#g|_$t|_%d|_&d|_'d|_(t|_)d|_*d|_+d|_,d|_-d|_.t	d|_/t	d	|_0t|_1t2ƒ|_3xG|j4ƒD]9}|t5krýt6d
|ƒ‚nt7||||ƒqØWdS(sô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.
        R@RRR R)iR8R5R6s Unknown SoSOptions attribute: %sN(8R
tFalseRR
RAR,RRRt
_arg_defaultsRRRRRRRRRRRRRRRR R!R"RR#R$R%R&R'R(R)R*R+R-R.R/R0R1R2R3R4t
upload_methodR5R6R7tsetREtkeysRPt
ValueErrorRF(RItkwargsRQ((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt__init__”sh
							

													
									
											

	cCstƒ}|j|tƒ|S(sInitialise 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
        (R?RRRg(tclsR_topts((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt	from_argsÖs		cCsld}d}||kr#d|gS||krYgtdt|ƒƒD]}d|^qESd|d|gS(sçConvert 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).
        Rsallow-system-changessall-logsRRRRslist-pluginsslist-presetss
list-profiless	no-reportsno-env-varsR+R7tverboses--%sis--t=(s
alloptionssallow-system-changessall-logssbatchsbuildsdebugsexperimentalslist-pluginsslist-presetss
list-profiless	no-reportsno-env-varssquietsverify(sverbose(trangetint(RqRJR<tno_valuetcounttd((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt_opt_to_argsãs*cCs9tƒ}tƒ}yVy&t|ƒ}|j|ƒWdQXWn)ttfk
rf}td|ƒ‚nXWn6ttfk
r }td||j	dfƒ‚nX|j
dƒrg}x6|jdƒD]%\}	}
|jtj
|	|
ƒƒqÆW|j|j|ƒ|ƒng|_|jddƒrg|jjg|jddƒjdƒD]}|jƒ^qKƒn|jddƒrÃg|_|jjg|jddƒjdƒD]}|jƒ^q§ƒn|j
d	ƒr5g|_xW|jd	ƒD]C\}	}
|	jd
ƒd|jkrë|jj|	d|
ƒqëqëWn|S(
Ns%Failed to parse configuration file %ss)Unable to read configuration file %s : %sitgeneraltpluginstdisableRTtenablettunablest.iRu(R?RtopentreadfpRRtexittOSErrortIOErrorR_thas_sectiontitemstextendR{RRt
parse_argsR!t
has_optiontgettsplitRYRR(tappend(Rqt	argparserRRLRrtconfigtftetoptlistRJR<tplugin((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt	from_fileös@			5		5	"cCs\xUtD]M}t||ƒs"qnt||ƒdk	s>|r|j||tƒqqWdS(sNMerge 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.
        N(RPRCRDRARORi(RIRKtskip_defaultRQ((s0/usr/lib/python2.7/site-packages/sos/__init__.pytmerges
	
cCsIi}x<tD]4}t||ƒ}|dkr7d}n|||<q
W|S(s²Return this ``SoSOptions`` option values as a dictionary of
            argument name to value mappings.

            :returns: a name:value dictionary of option values.
        R
RRR%(s
add_presets
del_presetsdescsnoteN(RPRDRA(RItodictRQtvalue((s0/usr/lib/python2.7/site-packages/sos/__init__.pytdict-s
	cswd„‰‡fd†}d„}t|jƒjƒdd„ƒ}g|D]*\}}|||ƒrI|||ƒ^qIS(sðReturn command arguments for this object.

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

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

        cSsPd}|s||krtS|tkrLt|ƒtt|ƒkrLtSntS(s. Test for non-null option values.
            RiRAs[]s""s''t0(sFalsesNones[]s""s''R›(RiRjtstrRg(tnameR™tnull_values((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt	has_valueEscs|dkrtSˆ||ƒS(s8 Filter out preset and null-valued options.
            R
RRR%(s
add_presets
del_presetsdescsnote(Ri(RR™(RŸ(s0/usr/lib/python2.7/site-packages/sos/__init__.pyt
filter_optPscSs©|jdƒr'dt|ƒd}|S|jddƒ}t|ƒrTdj|ƒn|}|tk	ryd||f}n|}t|ƒdkr›d|nd|}|S(	sD Convert sos option notation to command line arguments.
            R6t-Rbt_RTs%s %sis--(t
startswithRwtreplaceR>RZRgtlen(RR™RQRJ((s0/usr/lib/python2.7/site-packages/sos/__init__.pytargifyWs!&tkeycSs|dS(Ni((tx((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt<lambda>ks(tsortedRšRˆ(RIR R¦t	opt_itemstnRb((RŸs0/usr/lib/python2.7/site-packages/sos/__init__.pytto_args<s
			!(t__name__t
__module__RORRRiRdReRhRptclassmethodRsR{RgR•R—RšR­(((s0/usr/lib/python2.7/site-packages/sos/__init__.pyR?Ts					B
'	(t__doc__RRVtargparseRtPY3tconfigparserRRRt__version__tgettext_dirRtbindtextdomainR	t_sosRPRjR>tobjectR?(((s0/usr/lib/python2.7/site-packages/sos/__init__.pyt<module>s<		

	
Back to Directory File Manager