File: //usr/lib/python3.6/site-packages/awscli/customizations/gamelift/__pycache__/getlog.cpython-36.pyc
3
�T_- � @ s@ d dl Z d dlmZ d dlmZ d dlmZ G dd� de�ZdS )� N)�partial)�urlopen)�BasicCommandc @ s4 e Zd ZdZdZdddd�dddd�gZd d
� ZdS )�GetGameSessionLogCommandzget-game-session-logz2Download a compressed log file for a game session.zgame-session-idTzThe game session ID)�nameZrequiredZ help_textzsave-asz5The filename to which the file should be saved (.zip)c C s� | j jd|j|j|jd�}|j|jd�}|d }t|�}tj j
d|j � t|jd��,}x$t
t|jd�d�D ]}|j
|� qlW W d Q R X tj j
d |j|jf � d
S )NZgamelift)Zregion_name�endpoint_urlZverify)Z
GameSessionIdZPreSignedUrlz/Downloading log archive for game session %s...
�wbi � z>Successfully downloaded log archive for game session %s to %s
r )Z_sessionZ
create_clientZregionr Z
verify_sslZget_game_session_log_urlZgame_session_idr �sys�stdout�write�openZsave_as�iterr �read) �self�argsZparsed_globalsZclientZresponseZurl�contents�f�chunk� r �/usr/lib/python3.6/getlog.py� _run_main s$
z"GetGameSessionLogCommand._run_mainN)�__name__�
__module__�__qualname__�NAMEZDESCRIPTIONZ ARG_TABLEr r r r r r s
r )r
� functoolsr Z
awscli.compatr Zawscli.customizations.commandsr r r r r r �<module>
s