
    J                         S r SSKJr  SSKJr  SSKJr  SSKJr  SSKrSSKrSSKrS r	\R                  (       a  S rg\R                  (       a  S	 rgg)
z Read JSON objects from a stream.    )absolute_import)division)print_function)unicode_literalsNc              #      #    [        U 5       H8  nU(       d  M  [        R                  " [        R                  " U5      5      v   M:     g7f)zRead the events from the skaffold event stream.

Args:
  file_obj: A File object.

Yields:
  Event dicts from the JSON payloads.
N)_ReadStreamingLinesjsonloadssix
ensure_strfile_objlines     2lib/googlecloudsdk/command_lib/code/json_stream.pyReadJsonStreamr      s4      "(+d
**S^^D)
** ,s   A	Ac              #      #    [         R                  " [        5         U  H  nUv   M	     S S S 5        g ! , (       d  f       g = f7f)N)
contextlibsuppressConnectionResetErrorr   s     r   r   r   ,   s.     			1	2$
  
3	2	2s   A4	A
AAc              #   j   #     Sn U R                  S5      nU(       d  gUS:X  a  OX-  nM&  Uv   M/  7f)a  Python 2 compatibility with py3's streaming behavior.

If file_obj is an HTTPResponse, iterating over lines blocks until a buffer
is full.

Args:
  file_obj: A file-like object, including HTTPResponse.

Yields:
  Lines, like iter(file_obj) but without buffering stalls.
       N   
)read)r   r   bytes      r   r   r   3   sH      d}}Q
5=
  j s   13)__doc__
__future__r   r   r   r   r   r	   r   r   PY3r   PY2 r   r   <module>r!      sE    ' &  % '   
+ 77
 	WW r   