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.jobs.runners.util.job_script package

galaxy.jobs.runners.util.job_script.check_script_integrity(config)[source]
galaxy.jobs.runners.util.job_script.job_script(template=<string.Template object>, **kwds)[source]
>>> has_exception = False
>>> try: job_script()
... except Exception as e: has_exception = True
>>> has_exception
True
>>> script = job_script(working_directory='wd', command='uptime', exit_code_path='ec')
>>> '\nuptime\n' in script
True
>>> 'echo $? > ec' in script
True
>>> 'GALAXY_LIB="None"' in script
True
>>> script.startswith('#!/bin/sh\n#PBS -test\n')
False
>>> script = job_script(working_directory='wd', command='uptime', exit_code_path='ec', headers='#PBS -test')
>>> script.startswith('#!/bin/bash\n\n#PBS -test\n')
True
>>> script = job_script(working_directory='wd', command='uptime', exit_code_path='ec', slots_statement='GALAXY_SLOTS="$SLURM_JOB_NUM_NODES"')
>>> script.find('GALAXY_SLOTS="$SLURM_JOB_NUM_NODES"\n') > 0
True
>>> script = job_script(working_directory='wd', command='uptime', exit_code_path='ec', memory_statement='GALAXY_MEMORY_MB="32768"')
>>> script.find('GALAXY_MEMORY_MB="32768"\n') > 0
True
galaxy.jobs.runners.util.job_script.write_script(path, contents, config, mode=493)[source]