HEX
Server: Apache
System: Linux aura.ambarhosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User: chicagos (1295)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python2.7/site-packages/awscli/compat.pyc
�
R$�_c@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddl	mZe
jZe
j
Z
e
jjZe
jjZe
jZe
jZe
jjjjZe
jZe
jjjZyddlZejZWnek
r'ejZnXyddlZWnek
rQdZnXejdkZ e rpdZ!ndZ!de"fd��YZ#d	e$fd
��YZ%d�Z&e
j
r-ddl'j(Z)ddl*Z*ddl+j,Z-ddl.m/Z/e0Z1d
�Z2d�Z3d�Z4ddd�Z5dd�Z6n�ddl7Z7ddl8Z)ddl*Z*ddl9Z9ddl-Z-ddl:m/Z/e1Z1d�Z2d�Z3d�Z4ddd�Z5dd�Z6d�Z;d�Z<d�Z=dd�Z>d�Z?dd�Z@ejAd��ZByddlmCZCWn�ek
r�d ZDd!�ZEejFd"ejG�ZHejFd#ejG�ZIejFd$ejG�ZJd<ZKd4�ZLejFd5ejM�ZNejFd6ejM�ZOejFd7ejM�ZPd8d8d8eKd9d:�ZCd;�ZQnXdS(=i����N(tsix(tOrderedDicttwin32tmoresless -RtStdinMissingErrorcBseZd�ZRS(cCs d}tt|�j|�dS(Ns;stdin is required for this operation, but is not available.(tsuperRt__init__(tselftmessage((s1/usr/lib/python2.7/site-packages/awscli/compat.pyRDs(t__name__t
__module__R(((s1/usr/lib/python2.7/site-packages/awscli/compat.pyRCstNonTranslatedStdoutcBs eZdZd�Zd�ZRS(s This context manager sets the line-end translation mode for stdout.

    It is deliberately set to binary mode so that `
` does not get added to
    the line ending. This can be useful when printing commands where a
    windows style line ending would casuse errors.
    cCsFtjdkr?ddl}|jtjj�tj�|_ntjS(NRi����(	tsystplatformtmsvcrttsetmodetstdouttfilenotostO_BINARYt
previous_mode(RR((s1/usr/lib/python2.7/site-packages/awscli/compat.pyt	__enter__Ss
cCs>tjdkr:ddl}|jtjj�|j�ndS(NRi����(RR
RRRRR(Rttypetvaluet	tracebackR((s1/usr/lib/python2.7/site-packages/awscli/compat.pyt__exit__Zs(R	R
t__doc__RR(((s1/usr/lib/python2.7/site-packages/awscli/compat.pyRKs	cCsOt|tj�r|St|tj�r5|jd�Stdt|���dS(Nsutf-8s,Expected str, unicode or bytes, received %s.(t
isinstanceRt	text_typetbinary_typetdecodet
ValueErrorR(ts((s1/usr/lib/python2.7/site-packages/awscli/compat.pytensure_text_type`s

(tURLErrorcCs%tjdkrt��ntjjS(N(RtstdintNoneRtbuffer(((s1/usr/lib/python2.7/site-packages/awscli/compat.pytget_binary_stdinqscCs
tjjS(N(RRR%(((s1/usr/lib/python2.7/site-packages/awscli/compat.pytget_binary_stdoutvscCs|S(N((tstreamterrors((s1/usr/lib/python2.7/site-packages/awscli/compat.pyt_get_text_writerystrcCs.d|krtj�}nt||d|�S(s>Back-port open() that accepts an encoding argument.

        In python3 this uses the built in open() and in python2 this
        uses the io.open() function.

        If the file is not being opened in binary mode, then we'll
        use locale.getpreferredencoding() to find the preferred
        encoding.

        tbtencoding(tlocaletgetpreferredencodingtopen(tfilenametmodeR-((s1/usr/lib/python2.7/site-packages/awscli/compat.pytcompat_open|scCsW|dkrtj}nt|dd�r=|jj|�n|j|jd��dS(sE
        This function is used to write raw bytes to stdout.
        R%sutf-8N(R$RRtgetattrR%twriteR(t	statementR((s1/usr/lib/python2.7/site-packages/awscli/compat.pytbytes_print�s
cCs"tjdkrt��ntjS(N(RR#R$R(((s1/usr/lib/python2.7/site-packages/awscli/compat.pyR&�scCstjS(N(RR(((s1/usr/lib/python2.7/site-packages/awscli/compat.pyR'�scCs7tj�}|dkr!d}ntj|�||�S(Ntascii(R.R/R$tcodecst	getwriter(R(R)R-((s1/usr/lib/python2.7/site-packages/awscli/compat.pyR*�s	cCs1d|krtj�}ntj||d|�S(NR,R-(R.R/tioR0(R1R2R-((s1/usr/lib/python2.7/site-packages/awscli/compat.pyR3�scCs)|dkrtj}n|j|�dS(N(R$RRR5(R6R((s1/usr/lib/python2.7/site-packages/awscli/compat.pyR7�scCsttjdd�S(NR)tstrict(R*RR(((s1/usr/lib/python2.7/site-packages/awscli/compat.pytget_stdout_text_writer�scCsttjdd�S(NR)treplace(R*Rtstderr(((s1/usr/lib/python2.7/site-packages/awscli/compat.pytget_stderr_text_writer�scCs$tjj|�tjj�t�S(su
    Cygwin's pty's are based on pipes. Therefore, when it interacts with a Win32
    program (such as Win32 python), what that program sees is a pipe instead of
    a console. This is important because python buffers pipes, and so on a
    pty-based terminal, text will not necessarily appear immediately. In most
    cases, this isn't a big deal. But when we're doing an interactive prompt,
    the result is that the prompts won't display until we fill the buffer. Since
    raw_input does not flush the prompt, we need to manually write and flush it.

    See https://github.com/mintty/mintty/issues/56 for more details.
    (RRR5tflusht	raw_input(tprompt((s1/usr/lib/python2.7/site-packages/awscli/compat.pytcompat_input�s
cCs<|dkrtj}n|dkr.t|�St|�SdS(s�Return a shell-escaped version of the string *s*

    Unfortunately `shlex.quote` doesn't support Windows, so this method
    provides that functionality.
    RN(R$RR
t_windows_shell_quotetshlex_quote(R R
((s1/usr/lib/python2.7/site-packages/awscli/compat.pytcompat_shell_quote�s

cCs|s
dSg}d}x�|D]�}|dkr<|d7}q|dkr�|dkrr|jd|d�d}n|jd�q|dkr�|jd|�d}n|j|�qW|dkr�|jd|�ndj|�}d	|ksd
|krd|S|S(s�Return a Windows shell-escaped version of the string *s*

    Windows has potentially bizarre rules depending on where you look. When
    spawning a process via the Windows C runtime the rules are as follows:

    https://docs.microsoft.com/en-us/cpp/cpp/parsing-cpp-command-line-arguments

    To summarize the relevant bits:

    * Only space and tab are valid delimiters
    * Double quotes are the only valid quotes
    * Backslash is interpreted literally unless it is part of a chain that
      leads up to a double quote. Then the backslashes escape the backslashes,
      and if there is an odd number the final backslash escapes the quote.

    :param s: A string to escape
    :return: An escaped string
    s""is\it"is\"tt s	s"%s"(tappendtjoin(R tbufftnum_backspacest	charactertnew_s((s1/usr/lib/python2.7/site-packages/awscli/compat.pyRE�s,

		cCsNi}|dkrt}ntr1itd6}ntj|�}||d<|S(s�Returns the default pager to use dependent on platform

    :rtype: str
    :returns: A string represent the paging command to run based on the
        platform being used.
    tshelltargsN(R$t
default_pagert
is_windowstTruetshlextsplit(t	pager_cmdtpopen_kwargs((s1/usr/lib/python2.7/site-packages/awscli/compat.pytget_popen_kwargs_for_pager_cmd9s	
ccs�trtjg}ntjtjtjg}g}x*|D]"}|jtj|tj��q:Wz	dVWdx.t|�D] \}}tj|||�qyWXdS(sG
    Ignores user entered signals to avoid process getting killed.
    N(RTtsignaltSIGINTtSIGQUITtSIGTSTPRKtSIG_IGNt	enumerate(tsignal_listtactual_signalstuser_signaltsig((s1/usr/lib/python2.7/site-packages/awscli/compat.pytignore_user_entered_signalsMs
 	(tlinux_distributions/etcc
Cs�tjjd�r�d}td���}x�|D]y}|j�}t|�dkr.|\}}nq.|dkr|j�}q.|dkr.|jd�}|d}q.q.WWdQX|||fStjjd�r;td��Z}xP|D]H}|jd�}	t|	�dkr�|	d	d
kr�d
|	d|fSq�WWdQXntjjd�r�tjd�}
xBt	t|
�dd
d
�D]$}|
|d dkry|
|=qyqyW|
r�|
j
�d}|
d
d}|||fSn|||fS(s� Tries some special tricks to get the distribution
            information in case the default method fails.
            Currently supports older SuSE Linux, Caldera OpenLinux and
            Slackware Linux distributions.
        s/var/adm/inst-log/infotSuSEitMIN_DIST_VERSIONt
DIST_IDENTt-Ns/etc/.installedit	OpenLinuxis/usr/lib/setupi����isslack-version-t	slackware(RtpathtexistsR0RWtlentstriptisdirtlistdirtrangetsort(tdistnametversiontidtftlinettvttagRtvaluestpkgtverfilestn((s1/usr/lib/python2.7/site-packages/awscli/compat.pyt_dist_try_hardergs>


"#
s(\w+)[-_](release|version)s'(.+) release ([\d.]+)[^(]*(?:\((.+)\))?s1([^0-9]+)(?: release )?([\d.]+)[^(]*(?:\((.+)\))?RgtdebiantfedoratredhattcentostmandraketmandrivatrocksRlt	yellowdogtgentootUnitedLinuxt
turbolinuxtarchtmageiacCs�d}d}tj|�}|dk	r7t|j��Stj|�}|dk	rbt|j��S|j�j�}|r�|d}t|�dkr�|d}q�nd||fS(NRIii(	t_lsb_release_versiontmatchR$ttupletgroupst_release_versionRpRWRo(t	firstlineRvRwtmtl((s1/usr/lib/python2.7/site-packages/awscli/compat.pyt_parse_release_file�s
s(?:DISTRIB_ID\s*=)\s*(.*)s(?:DISTRIB_RELEASE\s*=)\s*(.*)s(?:DISTRIB_CODENAME\s*=)\s*(.*)RIicCst|||||�S(N(t_linux_distribution(RuRvRwtsupported_diststfull_distribution_name((s1/usr/lib/python2.7/site-packages/awscli/compat.pyRf�sc	Csy�tdd���}x�|D]�}tj|�}|rO|jd�j�}ntj|�}|r||jd�j�}	ntj|�}|r|jd�j�}
qqW|r�|	r�||	|
fSWdQXWnttfk
r�nXyt	j
t�}Wntk
r|||fSX|j
�xd|D]L}tj|�}|dk	r)|j�\}
}|
|kru|
}Pquq)q)Wt|||�Stt	jjt|�ddddd��}|j�}WdQXt|�\}
}}|
r�|r�|
}n|r|}n|r|}n|||fS(	s Tries to determine the name of the Linux OS distribution name.
            The function first looks for a distribution release file in
            /etc and then reverts to _dist_try_harder() in case no
            suitable files are found.
            supported_dists may be given to define the set of Linux
            distributions to look for. It defaults to a list of currently
            supported Linux distributions identified by their release file
            name.
            If full_distribution_name is true (default), the full
            distribution read from the OS is returned. Otherwise the short
            name taken from supported_dists is used.
            Returns a tuple (distname, version, id) which default to the
            args given as parameters.
        s/etc/lsb-releaseR+iNR-sutf-8R)tsurrogateescape(R0t_distributor_id_file_retsearchtgroupRpt_release_file_ret_codename_file_retEnvironmentErrortUnboundLocalErrorRRrt_UNIXCONFDIRtOSErrorRtt_release_filenameR�R$R�R�RmRLtreadlineR�(RuRvRwR�R�t	etclsbrelRyR�t_u_distnamet
_u_versiont_u_idtetctfilet	_distnametdummyRxR�t_versiont_id((s1/usr/lib/python2.7/site-packages/awscli/compat.pyR��sP



			(sSuSEsdebiansfedorasredhatscentossmandrakesmandrivasrockss	slackwares	yellowdogsgentoosUnitedLinuxs
turbolinuxsarchR�(RRtreRVRtos.pathR
tzipfileR[t
contextlibtbotocore.compatRRtadvance_iteratortPY3tmovestqueueRFtStringIOtBytesIOturllibtrequestturlopenRtconfigparsertRawConfigParsertzlibtZIP_DEFLATEDtZIP_COMPRESSION_MODEtImportErrort
ZIP_STOREDtsqlite3R$RTRSt	ExceptionRtobjectRR!tcollections.abctabctcollections_abcR.turllib.parsetparseturlparseturllib.errorR"tinputRBR&R'R*R3R7R9tcollectionsR;turllib2R=R@RDRGRERZtcontextmanagerReRfR�R�tcompiletASCIIR�R�R�t_supported_distsR�tIR�R�R�R�(((s1/usr/lib/python2.7/site-packages/awscli/compat.pyt<module>
s�					




													?
	0