INNER CODE UNIT · Python
write_files
terraform-aws-modules/terraform-aws-lambda · package.py:408
def write_files(self, files_stream, prefix=None, timestamp=None):
"""
Expects just files stream, directories will be created automatically
"""
self._ensure_open()
for file_path, arcname in files_stream:
self._write_file(file_path, prefix, arcname, timestamp)
def write_file(self, file_path, prefix=None, name=None, timestamp=None):
"""
Reads a file and writes it to a prefix
or a full qualified name in a zip archive
"""
self._ensure_open()
self._write_file(file_path, prefix, name, timestamp)
def _write_file(self, file_path, prefix=None, name=None, timestamp=None):
arcname = name if name else os.path.basename(file_path)