parameters: (self, directory_path, file_name=None, aggregated_directories=None, aggregated_content=None, extra_args=None, keep=False)
docstring: Creates an object in an S3 bucket using a zip file created from the contents of the specified directory.
  
          Args:
  
              directory_path: The path to the directory to upload. The object's name in the
              S3 bucket will be the uploader's key with '/', the last element of the path,
              and '.zip' appended.
  
              aggregated_directories (named): a dictionary where the values are additional
              directories whose contents will be included in the zip file, as either a single
              directory path string or a list of directory path strings. The keys are
              the path in the zip file where the content is put. By default no additional
              directories are included.
  
              aggregated_content (named): a dictionary where the values are additional content
              to include in the zip file. The keys are the path in the zip file where the
              content is put. By default no additional content is included.
  
              file_name (named): the name of the zip file. By default the directory name with
              '.zip' appended is used.
  
              keep (named): keep the zip file after uploading. By default the zip file is deleted.
  
          Returns:
  
              The key of the uploaded zip file.
  
          Note:
  
              The directory may contain a .ignore file. If it does, the file should contain
              the names of the files in the directory that will not be included in the zip.
docstring_summary: Creates an object in an S3 bucket using a zip file created from the contents of the specified directory.
docstring_tokens: Creates an object in an S3 bucket using a zip file created from the contents of the specified directory .
function: def zip_and_upload_directory(self, directory_path, file_name=None, aggregated_directories=None, aggregated_content=None, extra_args=None, keep=False):
          """Creates an object in an S3 bucket using a zip file created from the contents of the specified directory.
  
          Args:
  
              directory_path: The path to the directory to upload. The object's name in the
              S3 bucket will be the uploader's key with '/', the last element of the path,
              and '.zip' appended.
  
              aggregated_directories (named): a dictionary where the values are additional
              directories whose contents will be included in the zip file, as either a single
              directory path string or a list of directory path strings. The keys are
              the path in the zip file where the content is put. By default no additional
              directories are included.
  
              aggregated_content (named): a dictionary where the values are additional content
              to include in the zip file. The keys are the path in the zip file where the
              content is put. By default no additional content is included.
  
              file_name (named): the name of the zip file. By default the directory name with
              '.zip' appended is used.
  
              keep (named): keep the zip file after uploading. By default the zip file is deleted.
  
          Returns:
  
              The key of the uploaded zip file.
  
          Note:
  
              The directory may contain a .ignore file. If it does, the file should contain
              the names of the files in the directory that will not be included in the zip.
  
          """
  
          zip_file_path = file_util.zip_directory(
              self.context,
              directory_path,
              aggregated_content=aggregated_content,
              aggregated_directories=aggregated_directories)
  
          try:
  
              file_name = file_name or os.path.basename(directory_path) + '.zip'
              return self.__upload_file(file_name, zip_file_path, extra_args=extra_args)
  
          finally:
              if os.path.exists(zip_file_path) and not keep:
                  self.context.view.deleting_file(zip_file_path)
                  os.remove(zip_file_path)
function_tokens: def zip_and_upload_directory ( self , directory_path , file_name = None , aggregated_directories = None , aggregated_content = None , extra_args = None , keep = False ) : zip_file_path = file_util . zip_directory ( self . context , directory_path , aggregated_content = aggregated_content , aggregated_directories = aggregated_directories ) try : file_name = file_name or os . path . basename ( directory_path ) + '.zip' return self . __upload_file ( file_name , zip_file_path , extra_args = extra_args ) finally : if os . path . exists ( zip_file_path ) and not keep : self . context . view . deleting_file ( zip_file_path ) os . remove ( zip_file_path )