MCPcopy Index your code
hub / github.com/aws/aws-cli / save_file

Method save_file

awscli/customizations/streamingoutputarg.py:105–121  ·  view source on GitHub ↗
(self, parsed, **kwargs)

Source from the content-addressed store, hash-verified

103 )
104
105 def save_file(self, parsed, **kwargs):
106 if self._response_key not in parsed:
107 # If the response key is not in parsed, then
108 # we've received an error message and we'll let the AWS CLI
109 # error handler print out an error message. We have no
110 # file to save in this situation.
111 return
112 body = parsed[self._response_key]
113 buffer_size = self._buffer_size
114 with open(self._output_file, 'wb') as fp:
115 data = body.read(buffer_size)
116 while data:
117 fp.write(data)
118 data = body.read(buffer_size)
119 # We don't want to include the streaming param in
120 # the returned response.
121 del parsed[self._response_key]

Callers

nothing calls this directly

Calls 2

readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected