swh.loader.mercurial.archive_extract module

swh.loader.mercurial.archive_extract.tmp_extract(archive, dir=None, prefix=None, suffix=None, log=None, source=None)[source]

Extract an archive to a temporary location with optional logs.

Parameters
  • archive (string) – Absolute path of the archive to be extracted

  • prefix (string) – Optional modifier to the temporary storage directory name. (I guess in case something goes wrong and you want to go look?)

  • log (python logging instance) – Optional for recording extractions.

  • source (string) – Optional source URL of the archive for adding to log messages.

Returns

A context manager for a temporary directory that automatically removes itself. See: help(tempfile.TemporaryDirectory)