Website : rimsha.abasa.com
backdoor
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
lib
/
python3
/
dist-packages
/
awscli
/
__pycache__
/
Filename :
shorthand.cpython-310.pyc
back
Copy
o @&�atD � @ s� d Z ddlZddlZddlmZ e� ZG dd� de�ZG dd� de�Z G dd � d e �Z G d d� de �ZG dd � d e�ZG dd� de�Z G dd� de�ZG dd� de�ZdS )a� Module for parsing shorthand syntax. This module parses any CLI options that use a "shorthand" syntax:: --foo A=b,C=d |------| | Shorthand syntax This module provides two main classes to do this. First, there's a ``ShorthandParser`` class. This class works on a purely syntactic level. It looks only at the string value provided to it in order to figure out how the string should be parsed. However, because there was a pre-existing shorthand parser, we need to remain backwards compatible with the previous parser. One of the things the previous parser did was use the associated JSON model to control how the expression was parsed. In order to accommodate this a post processing class is provided that takes the parsed values from the ``ShorthandParser`` as well as the corresponding JSON model for the CLI argument and makes any adjustments necessary to maintain backwards compatibility. This is done in the ``BackCompatVisitor`` class. � N)�is_document_typec @ s e Zd Zdd� Zdd� ZdS )�_NamedRegexc C s || _ t�|tj�| _d S �N)�name�re�compile�UNICODE�regex)�selfr � regex_str� r �2/usr/lib/python3/dist-packages/awscli/shorthand.py�__init__3 s z_NamedRegex.__init__c C s | j �|�S r )r �match�r �valuer r r r 7 s z_NamedRegex.matchN)�__name__� __module__�__qualname__r r r r r r r 2 s r c @ s e Zd Zdd� ZdS )�ShorthandParseErrorc C s� | j d| j}}}d| j d | j� v r&| j d | j� �d�}| j| d }d| j | jd � v rL| j| j | jd � �d� }| j d |� }| j |d � }d|d| d |f S )N� � � z%s %s%s� �^)r �index�rindex)r �consumed� remaining� num_spaces�last_newline�next_newliner r r �_error_location= s z#ShorthandParseError._error_locationN)r r r r"