???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
Š÷hc           @   sÑ  d  Z  d Z y d d l m Z Wn! e k
 rC d d l m Z n Xd d l Z d d l Z d d l Z d d l	 Z	 d d l
 Z
 d d l Z d d l m Z d d l m Z d d l m Z d Z e e j j e j j e j j e j j g ƒ Z e e j j e j j g ƒ Z e e j j e j j g ƒ Z d	 Z d
 Z d Z e	 j  e
 j! d ƒ ƒ Z" e	 j  d ƒ Z# d e$ f d „  ƒ  YZ% d e% f d „  ƒ  YZ& d e% f d „  ƒ  YZ' e( e( d e( d „ Z) e( e( d „ Z* d „  Z+ d e, f d „  ƒ  YZ- d „  Z. d „  Z/ d „  Z0 e( d „ Z1 e( d „ Z2 e
 j3 e4 f Z5 d e, f d  „  ƒ  YZ6 e( d! „ Z7 d" „  Z8 d# „  Z9 d$ „  Z: i d% d& g d' 6d( d) g d* 6d( d) g d+ 6d, d- g d. 6d/ d0 g d1 6d( d) g d2 6d3 d4 g d5 6Z; d S(6   st  Contains routines for printing protocol messages in JSON format.

Simple usage example:

  # Create a proto object and serialize it to a json format string.
  message = my_proto_pb2.MyMessage(foo='bar')
  json_string = json_format.MessageToJson(message)

  # Parse a json format string to proto object.
  message = json_format.Parse(json_string, my_proto_pb2.MyMessage())
s   jieluo@google.com (Jie Luo)iÿÿÿÿ(   t   OrderedDictN(   t   methodcaller(   t
   descriptor(   t   symbol_databases   %Y-%m-%dT%H:%M:%St   Infinitys	   -Infinityt   NaNsF   [\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]s   \[[a-zA-Z0-9\._]*\]$t   Errorc           B   s   e  Z d  Z RS(   s'   Top-level module error for json_format.(   t   __name__t
   __module__t   __doc__(    (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR   P   s   t   SerializeToJsonErrorc           B   s   e  Z d  Z RS(   s&   Thrown if serialization to JSON fails.(   R   R   R	   (    (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR
   T   s   t
   ParseErrorc           B   s   e  Z d  Z RS(   s    Thrown in case of parsing error.(   R   R   R	   (    (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR   X   s   i   c         C   s"   t  | | ƒ } | j |  | | ƒ S(   s_  Converts protobuf message to JSON format.

  Args:
    message: The protocol buffers message instance to serialize.
    including_default_value_fields: If True, singular primitive fields,
        repeated fields, and map fields will always be serialized.  If
        False, only serialize non-empty fields.  Singular message fields
        and oneof fields are not affected by this option.
    preserving_proto_field_name: If True, use the original proto field
        names as defined in the .proto file. If False, convert the field
        names to lowerCamelCase.
    indent: The JSON object will be pretty-printed with this indent level.
        An indent level of 0 or negative will only insert newlines.
    sort_keys: If True, then the output will be sorted by field names.

  Returns:
    A string containing the JSON formatted protocol buffer message.
  (   t   _Printert   ToJsonString(   t   messaget   including_default_value_fieldst   preserving_proto_field_namet   indentt	   sort_keyst   printer(    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyt   MessageToJson\   s    	c         C   s   t  | | ƒ } | j |  ƒ S(   sÌ  Converts protobuf message to a dictionary.

  When the dictionary is encoded to JSON, it conforms to proto3 JSON spec.

  Args:
    message: The protocol buffers message instance to serialize.
    including_default_value_fields: If True, singular primitive fields,
        repeated fields, and map fields will always be serialized.  If
        False, only serialize non-empty fields.  Singular message fields
        and oneof fields are not affected by this option.
    preserving_proto_field_name: If True, use the original proto field
        names as defined in the .proto file. If False, convert the field
        names to lowerCamelCase.

  Returns:
    A dict representation of the protocol buffer message.
  (   R   t   _MessageToJsonObject(   R   R   R   R   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyt   MessageToDictx   s    	c         C   s1   |  j  t j j k o0 |  j j o0 |  j j ƒ  j S(   N(   t   typeR   t   FieldDescriptort   TYPE_MESSAGEt   message_typet   has_optionst
   GetOptionst	   map_entry(   t   field(    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyt   _IsMapEntry’   s    R   c           B   sw   e  Z d  Z e e d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d	 „  Z d
 „  Z d „  Z RS(   s)   JSON format printer for protocol message.c         C   s   | |  _  | |  _ d  S(   N(   R   R   (   t   selfR   R   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyt   __init__›   s    	c         C   s(   |  j  | ƒ } t j | d | d | ƒS(   NR   R   (   R   t   jsont   dumps(   R    R   R   R   t   js(    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR   ¡   s    c         C   sh   | j  } | j } t | ƒ r+ |  j | ƒ S| t k rR t t | d | ƒ |  ƒ Si  } |  j | | ƒ S(   sE   Converts message to an object according to Proto3 JSON Specification.i    (   t
   DESCRIPTORt	   full_namet   _IsWrapperMessaget   _WrapperMessageToJsonObjectt   _WKTJSONMETHODSR   t   _RegularMessageToJsonObject(   R    R   t   message_descriptorR&   R$   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR   ¥   s    		c         C   sÁ  | j  ƒ  } y€x“| D]‹\ } } |  j r7 | j } n	 | j } t | ƒ rÇ | j j d } i  } xU | D]M }	 t |	 t ƒ r– |	 r d }
 qœ d }
 n |	 }
 |  j	 | | |	 ƒ | |
 <qi W| | | <q | j
 t j j k rg  | D] } |  j	 | | ƒ ^ qã | | <q | j r‹| } | j j ƒ  j r_| j t j j k r_| j
 t j j k r_| j } n  d | j | f } |  j	 | | ƒ | | <q |  j	 | | ƒ | | <q W|  j r‹| j } xÑ | j D]Ã } | j
 t j j k rñ| j t j j k sÁ| j r qÁn  |  j r| j } n	 | j } | | k r0qÁn  t | ƒ rIi  | | <qÁ| j
 t j j k rkg  | | <qÁ|  j	 | | j ƒ | | <qÁWn  Wn. t k
 r¼} t d j | j | ƒ ƒ ‚ n X| S(   s?   Converts normal message according to Proto3 JSON Specification.t   valuet   truet   falses   [%s.%s]s#   Failed to serialize {0} field: {1}.(    t
   ListFieldsR   t   namet	   json_nameR   R   t   fields_by_namet
   isinstancet   boolt   _FieldToJsonObjectt   labelR   R   t   LABEL_REPEATEDt   is_extensiont   containing_typeR   t   message_set_wire_formatR   R   t   LABEL_OPTIONALR&   R   R%   t   fieldst   cpp_typet   CPPTYPE_MESSAGEt   containing_oneoft   default_valuet
   ValueErrorR
   t   format(   R    R   R$   R<   R   R,   R0   t   v_fieldt   js_mapt   keyt   recorded_keyt   kt   fR+   t   e(    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR*   °   sf    				)						$c         C   sU  | j  t j j k r" |  j | ƒ S| j  t j j k r‡ | j j j | d ƒ } | d k	 rb | j
 S| j j d k rx | St d ƒ ‚ nÊ | j  t j j k rÎ | j t j j k rÇ t j | ƒ j d ƒ S| Snƒ | j  t j j k rí t | ƒ S| j  t k rt | ƒ S| j  t k rQt j | ƒ r;| d k  r4t St Sn  t j | ƒ rQt Sn  | S(   s<   Converts field value according to Proto3 JSON Specification.t   proto3sK   Enum field contains an integer value which can not mapped to an enum value.s   utf-8g        N(   R=   R   R   R>   R   t   CPPTYPE_ENUMt	   enum_typet   values_by_numbert   gett   NoneR0   t   filet   syntaxR
   t   CPPTYPE_STRINGR   t
   TYPE_BYTESt   base64t	   b64encodet   decodet   CPPTYPE_BOOLR4   t   _INT64_TYPESt   strt   _FLOAT_TYPESt   matht   isinft   _NEG_INFINITYt	   _INFINITYt   isnant   _NAN(   R    R   R,   t
   enum_value(    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR5   õ   s2    

c         C   s¾   | j  ƒ  s i  St ƒ  } | j } | | d <t | ƒ } | j | j ƒ | j } | j } t | ƒ r} |  j	 | ƒ | d <| S| t
 k r® t t
 | d | ƒ |  ƒ | d <| S|  j | | ƒ S(   s<   Converts Any message according to Proto3 JSON Specification.s   @typeR,   i    (   R/   R    t   type_urlt   _CreateMessageFromTypeUrlt   ParseFromStringR,   R%   R&   R'   R(   R)   R   R*   (   R    R   R$   Rb   t   sub_messageR+   R&   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyt   _AnyMessageToJsonObject  s"    		
		c         C   s
   | j  ƒ  S(   s8   Converts message according to Proto3 JSON Specification.(   R   (   R    R   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyt   _GenericMessageToJsonObject+  s    c         C   sŽ   | j  d ƒ } | d k s' | d k r+ d S| d k rG |  j | j ƒ S| d k r_ | j } n t | | ƒ } | j j | } |  j | | ƒ S(   s>   Converts Value message according to Proto3 JSON Specification.t   kindt
   null_valuet
   list_valuet   struct_valueN(	   t
   WhichOneofRO   t   _ListValueMessageToJsonObjectRj   Rk   t   getattrR%   R2   R5   (   R    R   t   whichR,   t   oneof_descriptor(    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyt   _ValueMessageToJsonObject1  s    c         C   s#   g  | j  D] } |  j | ƒ ^ q
 S(   sB   Converts ListValue message according to Proto3 JSON Specification.(   t   valuesRq   (   R    R   R,   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyRm   A  s    c         C   s;   | j  } i  } x% | D] } |  j | | ƒ | | <q W| S(   s?   Converts Struct message according to Proto3 JSON Specification.(   R<   Rq   (   R    R   R<   t   retRE   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyt   _StructMessageToJsonObjectF  s
    	c         C   s   |  j  | j j d | j ƒ S(   NR,   (   R5   R%   R2   R,   (   R    R   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR(   N  s    (   R   R   R	   t   FalseR!   R   R   R*   R5   Rf   Rg   Rq   Rm   Rt   R(   (    (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR   ˜   s   			E	!					c         C   s   |  j  j d k S(   Ns   google/protobuf/wrappers.proto(   RP   R0   (   R+   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR'   S  s    c         C   sO   i  } xB |  D]: \ } } | | k r= t  d j | ƒ ƒ ‚ n  | | | <q W| S(   Ns'   Failed to load JSON: duplicate key {0}.(   R   RB   (   R$   t   resultR0   R,   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyt   _DuplicateCheckerW  s    c         C   st   t  j ƒ  } |  j d ƒ d } y | j j | ƒ } Wn& t k
 r] t d j |  ƒ ƒ ‚ n X| j | ƒ } | ƒ  S(   Nt   /iÿÿÿÿs1   Can not find message descriptor by type_url: {0}.(	   R   t   Defaultt   splitt   poolt   FindMessageTypeByNamet   KeyErrort	   TypeErrorRB   t   GetPrototype(   Rb   t   dbt	   type_nameR+   t   message_class(    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyRc   `  s    c         C   sŸ   t  |  t j ƒ s$ |  j d ƒ }  n  y: t j d k  rH t j |  ƒ } n t j |  d t ƒ} Wn. t	 k
 rŽ } t
 d j t | ƒ ƒ ƒ ‚ n Xt | | | ƒ S(   sb  Parses a JSON representation of a protocol message into a message.

  Args:
    text: Message JSON representation.
    message: A protocol buffer message to merge into.
    ignore_unknown_fields: If True, do not raise errors for unknown fields.

  Returns:
    The same message passed as argument.

  Raises::
    ParseError: On JSON parsing problems.
  s   utf-8i   i   t   object_pairs_hooks   Failed to load JSON: {0}.(   i   i   (   R3   t   sixt	   text_typeRV   t   syst   version_infoR"   t   loadsRw   RA   R   RB   RY   t	   ParseDict(   t   textR   t   ignore_unknown_fieldsR$   RI   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyt   Parsen  s     c         C   s    t  | ƒ } | j |  | ƒ | S(   s.  Parses a JSON dictionary representation into a message.

  Args:
    js_dict: Dict representation of a JSON message.
    message: A protocol buffer message to merge into.
    ignore_unknown_fields: If True, do not raise errors for unknown fields.

  Returns:
    The same message passed as argument.
  (   t   _Parsert   ConvertMessage(   t   js_dictR   R‹   t   parser(    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR‰   ˆ  s    R   c           B   sh   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z RS(   s(   JSON format parser for protocol message.c         C   s   | |  _  d  S(   N(   R‹   (   R    R‹   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR!   ž  s    c         C   sr   | j  } | j } t | ƒ r1 |  j | | ƒ n= | t k r^ t t | d | | ƒ |  ƒ n |  j | | ƒ d S(   sÒ   Convert a JSON object into a message.

    Args:
      value: A JSON object.
      message: A WKT or regular protocol message to record the data.

    Raises:
      ParseError: In case of convert problems.
    i   N(   R%   R&   R'   t   _ConvertWrapperMessageR)   R   t   _ConvertFieldValuePair(   R    R,   R   R+   R&   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyRŽ   ¢  s    
		!c         C   sš  g  } | j  } t d „  | j Dƒ ƒ } xk| D]c} y±| j | d ƒ } | sh | j j | d ƒ } n  | rà t j | ƒ rà | j s¢ t	 d j
 | j ƒ ƒ ‚ n  | d d !} d j | j d ƒ d  ƒ } | j j | ƒ } n  | s|  j rõ w/ n  t	 d j
 | j | | j ƒ ƒ ‚ n  | | k rFt	 d j
 | j  j | ƒ ƒ ‚ n  | j | ƒ | j d k	 r«| j j }	 |	 | k r›t	 d j
 | j  j |	 ƒ ƒ ‚ n  | j |	 ƒ n  | | }
 |
 d k r| j t j j k r| j j d	 k rt | | j ƒ } d
 | _ n | j | j ƒ w/ n  t | ƒ rN| j | j ƒ |  j |
 | | ƒ n—| j t j j k rl| j | j ƒ t  |
 t! ƒ st	 d j
 | |
 ƒ ƒ ‚ n  | j t j j k rx´ |
 D][ } t | | j ƒ j" ƒ  } | d k r| j  j d	 k rt	 d ƒ ‚ n  |  j# | | ƒ q¹WqåxÇ |
 D]C } | d k rCt	 d ƒ ‚ n  t | | j ƒ j t$ | | ƒ ƒ q"Wny | j t j j k rÉ| j% rš| j | } n t | | j ƒ } | j& ƒ  |  j# |
 | ƒ n t' | | j t$ |
 | ƒ ƒ Wq/ t	 k
 r=} | r(| j d k r(t	 d j
 | | ƒ ƒ ‚ q’t	 t( | ƒ ƒ ‚ q/ t) k
 rg} t	 d j
 | | ƒ ƒ ‚ q/ t* k
 r‘} t	 d j
 | | ƒ ƒ ‚ q/ Xq/ Wd S(   sö   Convert field value pairs into regular message.

    Args:
      js: A JSON object to convert the field value pairs.
      message: A regular protocol message to record the data.

    Raises:
      ParseError: In case of problems converting.
    c         s   s   |  ] } | j  | f Vq d  S(   N(   R1   (   t   .0RH   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pys	   <genexpr>Á  s   s)   Message type {0} does not have extensionsi   iÿÿÿÿt   .sV   Message type "{0}" has no field named "{1}".
 Available Fields(except extensions): {2}s9   Message type "{0}" should not have multiple "{1}" fields.s?   Message type "{0}" should not have multiple "{1}" oneof fields.s   google.protobuf.Valuei    s.   repeated field {0} must be in [] which is {1}.sA   null is not allowed to be used as an element in a repeated field.s   Failed to parse {0} field: {1}s   Failed to parse {0} field: {1}.N(+   R%   t   dictR<   RN   RO   R2   t   _VALID_EXTENSION_NAMEt   matcht   is_extendableR   RB   R&   t   joinRz   t
   Extensionst   _FindExtensionByNameR‹   t   appendR?   R0   R=   R   R   R>   R   Rn   Ri   t
   ClearFieldR   t   _ConvertMapFieldValueR6   R7   R3   t   listt   addRŽ   t   _ConvertScalarFieldValueR8   t   SetInParentt   setattrRY   RA   R~   (   R    R$   R   t   namesR+   t   fields_by_json_nameR0   R   t
   identifiert
   oneof_nameR,   Re   t   itemRI   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR’   µ  s˜    
								
		
 c         C   sí   t  | t ƒ r | r d Sy | d } Wn t k
 rG t d ƒ ‚ n Xt | ƒ } | j } | j } t | ƒ r‰ |  j | d | ƒ nH | t	 k rº t
 t	 | d | d | ƒ |  ƒ n | d =|  j | | ƒ | j ƒ  | _ | | _ d S(   s/   Convert a JSON representation into Any message.Ns   @types*   @type is missing when parsing any message.R,   i   (   R3   R•   R}   R   Rc   R%   R&   R'   R‘   R)   R   R’   t   SerializeToStringR,   Rb   (   R    R,   R   Rb   Re   R+   R&   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyt   _ConvertAnyMessage  s$    		"c         C   s   | j  | ƒ d S(   s?   Convert a JSON representation into message with FromJsonString.N(   t   FromJsonString(   R    R,   R   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyt   _ConvertGenericMessage7  s    c         C   sÆ   t  | t ƒ r% |  j | | j ƒ n t  | t ƒ rJ |  j | | j ƒ nx | d k rb d | _ n` t  | t	 ƒ r} | | _
 nE t  | t j ƒ r› | | _ n' t  | t ƒ r¶ | | _ n t d ƒ ‚ d S(   s1   Convert a JSON representation into Value message.i    s"   Unexpected type for Value message.N(   R3   R•   t   _ConvertStructMessageRk   RŸ   t   _ConvertListValueMessageRj   RO   Ri   R4   t
   bool_valueR„   t   string_typest   string_valuet   _INT_OR_FLOATt   number_valueR   (   R    R,   R   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyt   _ConvertValueMessage=  s    c         C   sb   t  | t ƒ s' t d j | ƒ ƒ ‚ n  | j d ƒ x' | D] } |  j | | j j ƒ  ƒ q; Wd S(   s5   Convert a JSON representation into ListValue message.s%   ListValue must be in [] which is {0}.Rr   N(   R3   RŸ   R   RB   R   R´   Rr   R    (   R    R,   R   R¨   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR®   N  s    c         C   sW   t  | t ƒ s' t d j | ƒ ƒ ‚ n  x) | D]! } |  j | | | j | ƒ q. Wd S(   s2   Convert a JSON representation into Struct message.s&   Struct must be in a dict which is {0}.N(   R3   R•   R   RB   R´   R<   (   R    R,   R   RE   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR­   W  s    c         C   s-   | j  j d } t | d t | | ƒ ƒ d S(   s3   Convert a JSON representation into Wrapper message.R,   N(   R%   R2   R£   R¡   (   R    R,   R   R   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR‘   `  s    c         C   sÓ   t  | t ƒ s- t d j | j | ƒ ƒ ‚ n  | j j d } | j j d } x | D]w } t | | t ƒ } | j	 t
 j j k r¨ |  j | | t | | j ƒ | ƒ qT t | | | ƒ t | | j ƒ | <qT Wd S(   s5  Convert map field value for a message map field.

    Args:
      value: A JSON object to convert the map field value.
      message: A protocol message to record the converted data.
      field: The descriptor of the map field to be converted.

    Raises:
      ParseError: In case of convert problems.
    s-   Map field {0} must be in a dict which is {1}.RE   R,   N(   R3   R•   R   RB   R0   R   R2   R¡   t   TrueR=   R   R   R>   RŽ   Rn   (   R    R,   R   R   t	   key_fieldt   value_fieldRE   t	   key_value(    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyRž   e  s    (   R   R   R	   R!   RŽ   R’   Rª   R¬   R´   R®   R­   R‘   Rž   (    (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR   ›  s   			j								c         C   s”  | j  t k r t |  ƒ S| j  t k r2 t |  ƒ S| j  t j j k rT t |  | ƒ S| j  t j j	 k r° | j
 t j j k r‹ t j |  ƒ St j |  ƒ r© t d ƒ ‚ n  |  Snà | j  t j j k r| j j j |  d ƒ } | d k r‰y( t |  ƒ } | j j j | d ƒ } Wn/ t k
 rBt d j |  | j j ƒ ƒ ‚ n X| d k r‰| j j d k re| St d j |  | j j ƒ ƒ ‚ q‰n  | j Sd S(   sB  Convert a single scalar field value.

  Args:
    value: A scalar value to convert the scalar field value.
    field: The descriptor of the field to convert.
    require_str: If True, the field value must be a str.

  Returns:
    The converted scalar field value

  Raises:
    ParseError: In case of convert problems.
  s   Unpaired surrogates)   Invalid enum value {0} for enum type {1}.RJ   N(   R=   t
   _INT_TYPESt   _ConvertIntegerRZ   t   _ConvertFloatR   R   RW   t   _ConvertBoolRR   R   RS   RT   t	   b64decodet   _UNPAIRED_SURROGATE_PATTERNt   searchR   RK   RL   t   values_by_nameRN   RO   t   intRM   RA   RB   R&   RP   RQ   t   number(   R,   R   t   require_strRa   RÂ   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR¡   €  s6    

		c         C   s}   t  |  t ƒ r4 |  j ƒ  r4 t d j |  ƒ ƒ ‚ n  t  |  t j ƒ rs |  j d ƒ d k rs t d j |  ƒ ƒ ‚ n  t |  ƒ S(   s§   Convert an integer.

  Args:
    value: A scalar value to convert.

  Returns:
    The integer value.

  Raises:
    ParseError: If an integer couldn't be consumed.
  s   Couldn't parse integer: {0}.t    iÿÿÿÿs   Couldn't parse integer: "{0}".(	   R3   t   floatt
   is_integerR   RB   R„   R…   t   findRÁ   (   R,   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyRº   °  s
    'c         C   s˜   |  d k r t  d ƒ ‚ n  y t |  ƒ SWnh t k
 r“ |  t k rO t d ƒ S|  t k re t d ƒ S|  t k r{ t d ƒ St  d j |  ƒ ƒ ‚ n Xd S(   s!   Convert an floating point number.t   nans.   Couldn't parse float "nan", use "NaN" instead.s   -inft   infs   Couldn't parse float: {0}.N(   R   RÅ   RA   R]   R^   R`   RB   (   R,   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR»   Å  s    


c         C   s`   | r> |  d k r t  S|  d k r& t St d j |  ƒ ƒ ‚ n  t |  t ƒ s\ t d ƒ ‚ n  |  S(   sÞ   Convert a boolean value.

  Args:
    value: A scalar value to convert.
    require_str: If True, value must be a str.

  Returns:
    The bool parsed.

  Raises:
    ParseError: If a boolean value couldn't be consumed.
  R-   R.   s$   Expected "true" or "false", not {0}.s&   Expected true or false without quotes.(   Rµ   Ru   R   RB   R3   R4   (   R,   RÃ   (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyR¼   Ø  s    Rf   Rª   s   google.protobuf.AnyRg   R¬   s   google.protobuf.Durations   google.protobuf.FieldMaskRm   R®   s   google.protobuf.ListValueRt   R­   s   google.protobuf.Structs   google.protobuf.TimestampRq   R´   s   google.protobuf.Value(<   R	   t
   __author__t   collectionsR    t   ImportErrort   ordereddictRT   R"   R[   t   reR„   R†   t   operatorR   t   google.protobufR   R   t   _TIMESTAMPFOMATt	   frozensetR   t   CPPTYPE_INT32t   CPPTYPE_UINT32t   CPPTYPE_INT64t   CPPTYPE_UINT64R¹   RX   t   CPPTYPE_FLOATt   CPPTYPE_DOUBLERZ   R^   R]   R`   t   compilet   uR¾   R–   t	   ExceptionR   R
   R   Ru   R   R   R   t   objectR   R'   Rw   Rc   RŒ   R‰   t   integer_typesRÅ   R²   R   R¡   Rº   R»   R¼   R)   (    (    (    s?   /usr/lib/python2.7/site-packages/google/protobuf/json_format.pyt   <module>)   s„   			»				å0			





