Submit
Path:
~
/
/
lib
/
python2.7
/
site-packages
/
awscli
/
File Content:
shorthand.pyc
� =��Xc @ s� d Z d d l Z d d l Z e � Z d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d S( s� 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. i����Nt _NamedRegexc B s e Z d � Z d � Z RS( c C s% | | _ t j | t j � | _ d S( N( t namet ret compilet UNICODEt regex( t selfR t regex_str( ( s0 /tmp/pip-build-uEGWVr/awscli/awscli/shorthand.pyt __init__1 s c C s | j j | � S( N( R t match( R t value( ( s0 /tmp/pip-build-uEGWVr/awscli/awscli/shorthand.pyR 5 s ( t __name__t __module__R R ( ( ( s0 /tmp/pip-build-uEGWVr/awscli/awscli/shorthand.pyR 0 s t ShorthandParseErrorc B s e Z d � Z d � Z RS( c C sJ | | _ | | _ | | _ | | _ | j � } t t | � j | � d S( N( R t expectedt actualt indext _construct_msgt superR R ( R R R R R t msg( ( s0 /tmp/pip-build-uEGWVr/awscli/awscli/shorthand.pyR : s c C s� | j d | j } } } d | j | j k r] | j | j j d � } | j | d } n d | j | j k r� | j | j | j j d � } | j | } | j | } n d | j | j | d | d | f } | S( Nt s i s1 Expected: '%s', received: '%s' for input: %s %s%st t ^( R R t rindexR R ( R t consumedt remainingt num_spacest last_newlinet next_newlineR ( ( s0 /tmp/pip-build-uEGWVr/awscli/awscli/shorthand.pyR B s ( R R R R ( ( ( s0 /tmp/pip-build-uEGWVr/awscli/awscli/shorthand.pyR 9 s t ShorthandParserc B sg e Z d Z e d d � Z e d d � Z d Z d Z d Z d Z e d d j d e d e d e � � Z e d d j d e d e d e � � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d&