snek5000.util.archive#

Post simulation archive-creation utilities

Functions

archive(tarball[, items, remove, readonly])

Archive simulation contents into a tarball / compress a tarball.

clean_simul(case, tarball)

Clean a simulation after archiving into a tarball.

compress_cmd(compress_format)

exec_compress(tarball)

exec_tar(tarball, items, remove)

parse_args_from_filename(tarball)

remove(items)

Equivalent to rm -rf

tar_cmd([compress_format, remove, append])

tar_name([root_name, pattern, ...])

Generate a tarball name based on contents of current working directory.

snek5000.util.archive.archive(tarball, items=(), remove=False, readonly=False)[source]#

Archive simulation contents into a tarball / compress a tarball.

Examples

>>> archive("test.tar.xz", ["file1", "file2"])
# runs tar -cvf test.tar.xz file1 file2
>>> archive("test.tar.gz")
# runs gzip test.tar
snek5000.util.archive.clean_simul(case, tarball)[source]#

Clean a simulation after archiving into a tarball.

snek5000.util.archive.exec_compress(tarball)[source]#
snek5000.util.archive.exec_tar(tarball, items, remove)[source]#
snek5000.util.archive.parse_args_from_filename(tarball)[source]#
snek5000.util.archive.compress_cmd(compress_format)[source]#
snek5000.util.archive.tar_cmd(compress_format='', remove=False, append=False)[source]#
snek5000.util.archive.tar_name(root_name='abl', pattern='*.f?????', compress_format='', subdir='data', default_prefix='test')[source]#

Generate a tarball name based on contents of current working directory.

snek5000.util.archive.remove(items)[source]#

Equivalent to rm -rf