Warning

This document is for an old release of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

galaxy.tools.imp_exp package

class galaxy.tools.imp_exp.JobImportHistoryArchiveWrapper(app, job_id)[source]

Bases: object, galaxy.model.item_attrs.UsesAnnotations

Class provides support for performing jobs that import a history from an archive.

__init__(app, job_id)[source]
cleanup_after_job()[source]

Set history, datasets, and jobs’ attributes and clean up archive directory.

class galaxy.tools.imp_exp.JobExportHistoryArchiveWrapper(job_id)[source]

Bases: object, galaxy.model.item_attrs.UsesAnnotations

Class provides support for performing jobs that export a history to an archive.

__init__(job_id)[source]
get_history_datasets(trans, history)[source]

Returns history’s datasets.

setup_job(trans, jeha, include_hidden=False, include_deleted=False)[source]

Perform setup for job to export a history into an archive. Method generates attribute files for export, sets the corresponding attributes in the jeha object, and returns a command line for running the job. The command line includes the command, inputs, and options; it does not include the output file because it must be set at runtime.

cleanup_after_job(db_session)[source]

Remove temporary directory and attribute files generated during setup for this job.

Submodules

galaxy.tools.imp_exp.export_history module

Export a history to an archive file using attribute files.

usage: %prog history_attrs dataset_attrs job_attrs out_file
-G, –gzip: gzip archive file
galaxy.tools.imp_exp.export_history.get_dataset_filename(name, ext, hid)[source]

Builds a filename for a dataset using its name an extension.

galaxy.tools.imp_exp.export_history.create_archive(history_attrs_file, datasets_attrs_file, jobs_attrs_file, out_file, gzip=False)[source]

Create archive from the given attribute/metadata files and save it to out_file.

galaxy.tools.imp_exp.export_history.main()[source]

galaxy.tools.imp_exp.unpack_tar_gz_archive module

Unpack a tar or tar.gz archive into a directory.

usage: %prog archive_source dest_dir
–[url|file] source type, either a URL or a file.
galaxy.tools.imp_exp.unpack_tar_gz_archive.check_archive(archive_file, dest_dir)[source]

Ensure that a tar archive has no absolute paths or relative paths outside the archive.

galaxy.tools.imp_exp.unpack_tar_gz_archive.main(options, args)[source]
galaxy.tools.imp_exp.unpack_tar_gz_archive.unpack_archive(archive_file, dest_dir)[source]

Unpack a tar and/or gzipped archive into a destination directory.

galaxy.tools.imp_exp.unpack_tar_gz_archive.url_to_file(url, dest_file)[source]

Transfer a file from a remote URL to a temporary file.