cwltool.context

Shared context objects that replace use of kwargs.

Module Contents

Classes

ContextBase

Shared kwargs based initializer for RuntimeContext and LoadingContext.

LoadingContext

Shared kwargs based initializer for RuntimeContext and LoadingContext.

RuntimeContext

Shared kwargs based initializer for RuntimeContext and LoadingContext.

Functions

make_tool_notimpl(toolpath_object, loadingContext)

Fake implementation of the make tool function.

log_handler(outdir, base_path_logs, stdout_path, ...)

Move logs from log location to final output.

set_log_dir(outdir, log_dir, subdir_name)

Set the log directory.

getdefault(val, default)

Return the val using the default as backup in case the val is None.

Attributes

default_make_tool

class cwltool.context.ContextBase(kwargs=None)

Shared kwargs based initializer for RuntimeContext and LoadingContext.

Parameters:

kwargs (Optional[Dict[str, Any]]) –

cwltool.context.make_tool_notimpl(toolpath_object, loadingContext)

Fake implementation of the make tool function.

Parameters:
  • toolpath_object (ruamel.yaml.comments.CommentedMap) –

  • loadingContext (LoadingContext) –

Return type:

cwltool.process.Process

cwltool.context.default_make_tool
cwltool.context.log_handler(outdir, base_path_logs, stdout_path, stderr_path)

Move logs from log location to final output.

Parameters:
  • outdir (str) –

  • base_path_logs (str) –

  • stdout_path (Optional[str]) –

  • stderr_path (Optional[str]) –

Return type:

None

cwltool.context.set_log_dir(outdir, log_dir, subdir_name)

Set the log directory.

Parameters:
  • outdir (str) –

  • log_dir (str) –

  • subdir_name (str) –

Return type:

str

class cwltool.context.LoadingContext(kwargs=None)

Bases: ContextBase

Inheritance diagram of cwltool.context.LoadingContext

Shared kwargs based initializer for RuntimeContext and LoadingContext.

Parameters:

kwargs (Optional[Dict[str, Any]]) –

copy()

Return a copy of this LoadingContext.

Return type:

LoadingContext

class cwltool.context.RuntimeContext(kwargs=None)

Bases: ContextBase

Inheritance diagram of cwltool.context.RuntimeContext

Shared kwargs based initializer for RuntimeContext and LoadingContext.

Parameters:

kwargs (Optional[Dict[str, Any]]) –

outdir: str | None
tmpdir: str = ''
tmpdir_prefix: str
tmp_outdir_prefix: str = ''
stagedir: str = ''
get_outdir()

Return outdir or create one with tmp_outdir_prefix.

Return type:

str

get_tmpdir()

Return tmpdir or create one with tmpdir_prefix.

Return type:

str

get_stagedir()

Return stagedir or create one with tmpdir_prefix.

Return type:

str

create_tmpdir()

Create a temporary directory that respects tmpdir_prefix.

Return type:

str

create_outdir()

Create a temporary directory that respects tmp_outdir_prefix.

Return type:

str

copy()

Return a copy of this RuntimeContext.

Return type:

RuntimeContext

cwltool.context.getdefault(val, default)

Return the val using the default as backup in case the val is None.

Parameters:
  • val (Any) –

  • default (Any) –

Return type:

Any