executejob

This module contains the following classes:

class aeneas.executejob.ExecuteJob(job=None, rconf=None, logger=None)[source]

Execute a job, that is, execute all of its tasks and generate the output container holding the generated sync maps.

If you do not provide a job object in the constructor, you must manually set it later, or load it from a container with load_job_from_container().

In the first case, you are responsible for setting the absolute audio/text/sync map paths of each task of the job, to their actual absolute location on the computing machine. Moreover, you are responsible for cleaning up any temporary files you might have generated around.

In the second case, you are responsible for calling clean() at the end of the job execution, to delete the working directory created by load_job_from_container() when creating the job object.

Parameters:
Raises:

ExecuteJobInputError: if job is not an instance of Job

clean(remove_working_directory=True)[source]

Remove the temporary directory. If remove_working_directory is True remove the working directory as well, otherwise just remove the temporary directory.

Parameters:remove_working_directory (bool) – if True, remove the working directory as well
execute()[source]

Execute the job, that is, execute all of its tasks.

Each produced sync map will be stored inside the corresponding task object.

Raises:ExecuteJobExecutionError: if there is a problem during the job execution
load_job(job)[source]

Load the job from the given Job object.

Parameters:job (Job) – the job to load
Raises:ExecuteJobInputError: if job is not an instance of Job
load_job_from_container(container_path, config_string=None)[source]

Load the job from the given aeneas.container.Container object.

If config_string is None, the container must contain a configuration file; otherwise use the provided config string (i.e., the wizard case).

Parameters:
  • container_path (string) – the path to the input container
  • config_string (string) – the configuration string (from wizard)
Raises:

ExecuteJobInputError: if the given container does not contain a valid Job

write_output_container(output_directory_path)[source]

Write the output container for this job.

Return the path to output container, which is the concatenation of output_directory_path and of the output container file or directory name.

Parameters:output_directory_path (string) – the path to a directory where the output container must be created
Return type:string
Raises:ExecuteJobOutputError: if there is a problem while writing the output container
exception aeneas.executejob.ExecuteJobExecutionError[source]

Error raised when the execution of the job fails for internal reasons.

exception aeneas.executejob.ExecuteJobInputError[source]

Error raised when the input parameters of the job are invalid or missing.

exception aeneas.executejob.ExecuteJobOutputError[source]

Error raised when the creation of the output container failed.