403Webshell
Server IP : 3.96.16.70  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3.9/site-packages/awscli/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/awscli/__pycache__/argprocess.cpython-39.pyc
a

wA�i�S�@s.dZddlZddlZddlmZmZddlmZddlm	Z	m
Z
mZddlm
Z
mZmZe�d�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZGdd�de�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd-d!d"�Zd#d$�Z d%d&�Z!Gd'd(�d(�Z"Gd)d*�d*e"�Z#Gd+d,�d,e"�Z$dS).zModule for processing CLI args.�N)�OrderedDict�json)�is_json_value_header)�
COMPLEX_TYPES�SCALAR_TYPES�	shorthand)�%find_service_and_method_in_event_name�is_document_type�is_document_type_containerzawscli.argprocesscseZdZ�fdd�Z�ZS)�
ParamErrorcs,d||f}tt|��|�||_||_dS)aB

        :type cli_name: string
        :param cli_name: The complete cli argument name,
            e.g. "--foo-bar".  It should include the leading
            hyphens if that's how a user would specify the name.

        :type message: string
        :param message: The error message to display to the user.

        z Error parsing parameter '%s': %sN)�superr�__init__�cli_name�message)�selfrr�full_message��	__class__��5/usr/lib/python3.9/site-packages/awscli/argprocess.pyr
 szParamError.__init__��__name__�
__module__�__qualname__r
�
__classcell__rrrrrsrc@seZdZdS)�ParamSyntaxErrorN�rrrrrrrr2srcseZdZ�fdd�Z�ZS)�ParamUnknownKeyErrorcs.d�|�}d|�d|��}tt|��|�dS)N�, z
Unknown key 'z', valid choices are: )�joinrrr
)r�keyZ
valid_keysrrrrr
7s
zParamUnknownKeyError.__init__rrrrrr6src@seZdZdS)�TooComplexErrorNrrrrrr!=sr!cCs:t|dd�}|jd|||f||||d�}|dur6|}|S)a
    Unpack an argument's value from the commandline. This is part one of a two
    step process in handling commandline arguments. Emits the load-cli-arg
    event with service, operation, and parameter names. Example::

        load-cli-arg.ec2.describe-instances.foo

    �nameZ	anonymouszload-cli-arg.%s.%s.%s)�param�value�service_name�operation_nameN)�getattrZemit_first_non_none_response)Zsessionr%r&�cli_argumentr$Z
param_nameZvalue_overriderrr�unpack_argumentAs�r)cCsg}t||�S�N��_detect_shape_structure)r#�stackrrr�detect_shape_structure\sr.csT|j�vrdS��|j��z(|jtvr6W���dS|jdkr҇fdd�|j��D�}t|�dkr�tdd�|D��r�W���d	St|�dkr�td
d�|D��r�W���dSdd
�	t
t|���W���Snh|jdk�r�dt|j
��W���S|jdk�r:|jjtv�r W���dSdt|j��W���SW���n
���0dS)N�	recursive�scalar�	structurecsg|]}t|���qSrr+��.0�p�r-rr�
<listcomp>js�z+_detect_shape_structure.<locals>.<listcomp>�css|]}|dkVqdS�r0Nrr2rrr�	<genexpr>r�z*_detect_shape_structure.<locals>.<genexpr>zstructure(scalar)css|]}|dkVqdSr8rr2rrrr9tr:zstructure(scalars)z
structure(%s)r�listzlist-%s�mapz
map-scalarzmap-%s)r"�append�	type_namer�pop�members�values�len�allr�sorted�setr,�memberr$)r#r-Z	sub_typesrr5rr,asH

�

�
��	����r,cCst|j||j�S)a1
    Parses and unpacks the encoded string command line parameter
    and returns native Python data structures that can be passed
    to the Operation.

    :type cli_argument: :class:`awscli.arguments.BaseCLIArgument`
    :param cli_argument: The CLI argument object.

    :param value: The value of the parameter.  This can be a number of
        different python types (str, list, etc).  This is the value as
        it's specified on the command line.

    :return: The "unpacked" argument than can be sent to the `Operation`
        object in python.
    )�_unpack_cli_arg�argument_modelr)r(r$rrr�unpack_cli_arg�s
�rIcCs.|j�d�r*|j�d�dkr*|jdkr*dSdS)NZ	jsonvalue�location�header�stringTF)�
serialization�getr>��modelrrr�
_special_type�s
���rQcCsTt|�st|�rt|||�S|jtvr2t|||�S|jtvrHt|||�St|�SdSr*)	rr	�_unpack_json_cli_argr>r�unpack_scalar_cli_argr�_unpack_complex_cli_arg�str)rHr$rrrrrG�s
�

rGc
CsLztj|td�WStyF}zt|d||f��WYd}~n
d}~00dS)N)Zobject_pairs_hookz"Invalid JSON: %s
JSON received: %s)r�loadsr�
ValueErrorr)rHr$r�errrrR�s�rRc	s�|j}|dks|dkrB|��ddkr2t||��St�d|��n�|dkr�t|t�rr|��ddkr�t||��SnBt|t�r�t|�dkr�|d��}|r�|ddkr�t||d��Sz|j	���fd	d
�|D�WSt
tfy�t�|d��Yn0dS)Nr1r<r�{zInvalid JSON:
%sr;�[r7csg|]}t�|���qSr)rG�r3�v�rZmember_shape_modelrrr6�sz+_unpack_complex_cli_arg.<locals>.<listcomp>)r>�lstriprRr�
isinstancerUr;rB�striprFrW�	TypeError)rHr$rr>Zsingle_valuerr]rrT�s(
�rT�cCs�|jdks|jdkrt|�S|jdks0|jdkr8t|�S|jdkr�|j�d�r�tj�|�}tj�|�}tj�	|�s�d}t
||��t|d�S|jd	kr�t|t
�r�|��d
kr�dSt|�S|SdS)NZintegerZlong�floatZdoubleZblobZ	streamingz%Blob values must be a path to a file.�rbZbooleanZfalseF)r>�intrcrMrN�os�path�
expandvars�
expanduser�isfiler�openr_rU�lower�bool)rHr$rZ	file_path�msgrrrrS�s2�����
�


rScCst|�rdSt|�S)NF)r
�_is_complex_shaperOrrr�_supports_shorthand_syntax�s
rpcCs,|jdvrdS|jdkr(|jjdvr(dSdS)N)r1r;r<Fr;T)r>rFrOrrrros

roc@seZdZdd�ZdS)�ParamShorthandcCsNddgidgdgdgd�dgdgdgdgd	�d
�}|�|i��|g�}||vS)z�
        Determines whether a given operation for a service needs to use the
        deprecated shorthand parsing case for lists of structures that only have
        a single member.
        zput-record-batchZrecordszreboot-workspace-requestszrebuild-workspace-requestszterminate-workspace-requests)zreboot-workspaceszrebuild-workspaceszterminate-workspaces�tagsZ	instances)zremove-tagszdescribe-instance-healthz'deregister-instances-from-load-balancerz%register-instances-with-load-balancer)ZfirehoseZ
workspacesZelb)rN)r�command_namer&Z
argument_nameZcasesrrr�_uses_old_list_cases���z"ParamShorthand._uses_old_list_caseN)rrrrtrrrrrqsrqc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�ParamShorthandParsercCst��|_t��|_dSr*)rZShorthandParser�_parserZBackCompatVisitor�_visitor�rrrrr
+s
zParamShorthandParser.__init__cKs0|�||�sdSt|�\}}|�||||�SdS)a�Attempt to parse shorthand syntax for values.

        This is intended to be hooked up as an event handler (hence the
        **kwargs).  Given ``param`` object and its string ``value``,
        figure out if we can parse it.  If we can parse it, we return
        the parsed value (typically some sort of python dict).

        :type cli_argument: :class:`awscli.arguments.BaseCLIArgument`
        :param cli_argument: The CLI argument object.

        :type param: :class:`botocore.parameters.Parameter`
        :param param: The parameter object (includes various metadata
            about the parameter).

        :type value: str
        :param value: The value for the parameter type on the command
            line, e.g ``--foo this_value``, value would be ``"this_value"``.

        :returns: If we can parse the value we return the parsed value.
            If it looks like JSON, we return None (which tells the event
            emitter to use the default ``unpack_cli_arg`` provided that
            no other event handlers can parsed the value).  If we
            run into an error parsing the value, a ``ParamError`` will
            be raised.

        N)�_should_parse_as_shorthandr�_parse_as_shorthand)rr(r$Z
event_name�kwargsrsr&rrr�__call__/s��zParamShorthandParser.__call__c
s�zzt�d|j���||||�}|dur.|WSt|t�r\�fdd�|D�}�j�||j�n�j	�
|�}�j�||j�Wnltjy�}zt
|jt|���WYd}~n@d}~0t
tfy�}zt
|jt|���WYd}~n
d}~00|S)NzParsing param %s as shorthandcsg|]}�j�|��qSr)rv�parser[rxrrr6er:z<ParamShorthandParser._parse_as_shorthand.<locals>.<listcomp>)�LOG�debugr�_handle_special_casesr_r;rwZvisitrHrvr}rZShorthandParseErrorrrUr)rr(r$rsr&Z
handled_value�parsedrXrrxrrzUs"�
$&z(ParamShorthandParser._parse_as_shorthandcs�|j}|jdkrf|jjdkrft|jj�dkrf|�|||j�rft|jj���d��fdd�|D�}|S|jdkr�t|j�dkr�d|jvr�|jdjdkr�d	|vr�d|iSdS)
Nr;r1r7rcsg|]}�|i�qSrrr[�Zkey_namerrr6�r:z>ParamShorthandParser._handle_special_cases.<locals>.<listcomp>�ValuerL�=)	rHr>rFrBr@rtr"r;�keys)rr(r$rsr&rPZ
new_valuesrr�rr�us2�
���������z*ParamShorthandParser._handle_special_casescCsT|rt|t�r|d}n|}t|t�rF|���d�rFt�d|j�dS|j}t	|�S)Nr)rZrYz=Param %s looks like JSON, not considered for param shorthand.F)
r_r;rUr`�
startswithr~rZpy_namerHrp)rr(r$Z	check_valrPrrrry�s
��z/ParamShorthandParser._should_parse_as_shorthandN)rrrr
r|rzr�ryrrrrru*s
& *ruc@sZeZdZdZe�ZdZdd�Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�ZdS)�ParamShorthandDocGenz3Documentation generator for param shorthand syntax.�cCs|durt|�SdS)z3Checks if a CLI argument supports shorthand syntax.NF)rp)rrHrrr�supports_shorthand�sz'ParamShorthandDocGen.supports_shorthandcCs||�|||�}||jurdS|r$|Sg}z:|jjdkrP|jj}|�||�dWS|�|j|�WSWntyvYdS0dS)a�Generate documentation for a CLI argument.

        :type cli_argument: awscli.arguments.BaseCLIArgument
        :param cli_argument: The CLI argument which to generate
            documentation for.

        :return: Returns either a string or ``None``.  If a string
            is returned, it is the generated shorthand example.
            If a value of ``None`` is returned then this indicates
            that no shorthand syntax is available for the provided
            ``argument_model``.

        Nr;z ...rb)r��	_DONT_DOCrHr>rF�_shorthand_docsr!)rr(rsr&Z	docstringr-rHrrr�generate_shorthand_example�s�
z/ParamShorthandDocGen.generate_shorthand_examplecCs�|j}|jdkr�|jjdkr�t|jj�dkr�|�|||j�r�t|jj�d}|j}|�	d�dkr||�	d�dkr|d|j
|fSd|j
|||fS|jdkr�t|j�dkr�d	|jvr�|jd	jd
kr�|jSdS)Nr;r1r7r�min�maxz%s %s1z%s %s1 %s2 %s3r�rLrb)rHr>rFrBr@rtr"r;�metadatarNrr�)rr(rsr&rP�member_namer�rrrr��s>�
���������z*ParamShorthandDocGen._handle_special_casescCs`t|�|jkrt��|jdkr*|�||�S|jdkr@|�||�S|jdkrV|�||�S|jSdS)Nr1r;r<)rB�
_MAX_STACKr!r>�_structure_docs�
_list_docs�	_map_docs)rrHr-rrrr�s


z$ParamShorthandDocGen._shorthand_docscCsj|j}|�|j�z|�|j|�}W|��n
|��0|jtvsNt|�dkrZd||fSd||fSdS)Nr7z[%s,%s]z%s,%s)rFr=r"r�r?r>rrB)rrHr-Zlist_memberZelement_docsrrrr�szParamShorthandDocGen._list_docscCs�|j}|�|jj�z|�|j|�}W|��n
|��0d||f}|jrr|sr|d7}|jD]}|d|7}q^n|r~d|}|S)NzKeyName1=%s,KeyName2=%sz

Where valid key names are:
z  %s
�{%s})r r=r$r"r�r?�enum)rrHr-�kZ
value_docs�startr�rrrr�s

zParamShorthandDocGen._map_docscCsPg}|j��D]&\}}t|�r q|�|�|||��qd�|�}|sH|Sd|S)N�,r�)r@�itemsr
r=�_member_docsr)rrHr-�partsr"Zmember_shapeZ
inner_partrrrr�,s
z$ParamShorthandDocGen._structure_docscCsP|�|j�dkrdS|�|j�z|�||�}W|��n
|��0d||fS)Nrz( ... recursive ... )z%s=%s)�countr"r=r�r?)rr"�shaper-Z	value_docrrrr�7sz!ParamShorthandDocGen._member_docsN)rrr�__doc__�objectr�r�r�r�r�r�r�r�r�r�rrrrr��s$ r�)rb)%r�ZloggingrfZbotocore.compatrrZbotocore.utilsrZawsclirrrZawscli.utilsrr	r
Z	getLoggerr~�	Exceptionrrrr!r)r.r,rIrQrGrRrTrSrprorqrur�rrrr�<module>
s4
"
	 
 	

Youez - 2016 - github.com/yon3zu
LinuXploit