l.s.t.LaunchpadWriteTarFile : class documentation

Part of lp.services.tarfile_helpers View In Hierarchy

Convenience wrapper around the tarfile module.

This class makes it convenient to generate tar files in various ways.

Method __init__ Undocumented
Class Method files_to_stream Turn a dictionary of files into a data stream.
Class Method files_to_string Turn a dictionary of files into a data string.
Class Method files_to_tarfile Turn a dictionary of files into a tarfile object.
Method close Close the archive.
Method add_directory Add a directory to the archive.
Method add_file Add a file to the archive.
Method add_files Add a number of files to the archive.
Method add_symlink Add a symbolic link to the archive.
Method _make_skeleton_tarinfo Make a basic TarInfo object to be fleshed out by the caller.
Method _ensure_directories Ensure that all the directories in the path are present.
def __init__(self, stream):
Undocumented
@classmethod
def files_to_stream(cls, files):
Turn a dictionary of files into a data stream.
@classmethod
def files_to_string(cls, files):
Turn a dictionary of files into a data string.
@classmethod
def files_to_tarfile(cls, files):
Turn a dictionary of files into a tarfile object.
def close(self):
Close the archive.

After the archive is closed, the data written to the filehandle will be complete. The archive may not be appended to after it has been closed.

def _make_skeleton_tarinfo(self, path, now):
Make a basic TarInfo object to be fleshed out by the caller.
def _ensure_directories(self, path, now):
Ensure that all the directories in the path are present.
def add_directory(self, path):
Add a directory to the archive.
def add_file(self, path, contents):
Add a file to the archive.
def add_files(self, files):
Add a number of files to the archive.
ParametersfilesA dictionary mapping file names to file contents.
def add_symlink(self, path, target):
Add a symbolic link to the archive.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.