cwltool.command_line_tool

Implementation of CommandLineTool.

Module Contents

Classes

PathCheckingMode

What characters are allowed in path names.

ExpressionJob

Job for ExpressionTools.

ExpressionTool

Base class for get_requirement().

AbstractOperation

Base class for get_requirement().

CallbackJob

Callback Job class, used by CommandLine.job().

CommandLineTool

Base class for get_requirement().

Functions

remove_path(f)

revmap_file(builder, outdir, f)

Remap a file from internal path to external path.

check_adjust(accept_re, builder, file_o)

Map files to assigned path inside a container.

check_valid_locations(fs_access, ob)

Attributes

OutputPortsType

class cwltool.command_line_tool.PathCheckingMode

Bases: enum.Enum

Inheritance diagram of cwltool.command_line_tool.PathCheckingMode

What characters are allowed in path names.

We have the strict (default) mode and the relaxed mode.

STRICT
RELAXED
class cwltool.command_line_tool.ExpressionJob(builder, script, output_callback, requirements, hints, outdir=None, tmpdir=None)

Job for ExpressionTools.

Parameters
  • builder (cwltool.builder.Builder) –

  • script (str) –

  • output_callback (Optional[cwltool.utils.OutputCallbackType]) –

  • requirements (List[cwltool.utils.CWLObjectType]) –

  • hints (List[cwltool.utils.CWLObjectType]) –

  • outdir (Optional[str]) –

  • tmpdir (Optional[str]) –

run(self, runtimeContext, tmpdir_lock=None)
Parameters
Return type

None

class cwltool.command_line_tool.ExpressionTool(toolpath_object, loadingContext)

Bases: cwltool.process.Process

Inheritance diagram of cwltool.command_line_tool.ExpressionTool

Base class for get_requirement().

Parameters
job(self, job_order, output_callbacks, runtimeContext)
Parameters
  • job_order (cwltool.utils.CWLObjectType) –

  • output_callbacks (Optional[cwltool.utils.OutputCallbackType]) –

  • runtimeContext (cwltool.context.RuntimeContext) –

Return type

Generator[ExpressionJob, None, None]

class cwltool.command_line_tool.AbstractOperation(toolpath_object, loadingContext)

Bases: cwltool.process.Process

Inheritance diagram of cwltool.command_line_tool.AbstractOperation

Base class for get_requirement().

Parameters
job(self, job_order, output_callbacks, runtimeContext)
Parameters
  • job_order (cwltool.utils.CWLObjectType) –

  • output_callbacks (Optional[cwltool.utils.OutputCallbackType]) –

  • runtimeContext (cwltool.context.RuntimeContext) –

Return type

cwltool.utils.JobsGeneratorType

cwltool.command_line_tool.remove_path(f)
Parameters

f (cwltool.utils.CWLObjectType) –

Return type

None

cwltool.command_line_tool.revmap_file(builder, outdir, f)

Remap a file from internal path to external path.

For Docker, this maps from the path inside tho container to the path outside the container. Recognizes files in the pathmapper or remaps internal output directories to the external directory.

Parameters
Return type

Optional[cwltool.utils.CWLObjectType]

class cwltool.command_line_tool.CallbackJob(job, output_callback, cachebuilder, jobcache)

Callback Job class, used by CommandLine.job().

Parameters
run(self, runtimeContext, tmpdir_lock=None)
Parameters
Return type

None

cwltool.command_line_tool.check_adjust(accept_re, builder, file_o)

Map files to assigned path inside a container.

We need to also explicitly walk over input, as implicit reassignment doesn’t reach everything in builder.bindings

Parameters
Return type

cwltool.utils.CWLObjectType

cwltool.command_line_tool.check_valid_locations(fs_access, ob)
Parameters
Return type

None

cwltool.command_line_tool.OutputPortsType
exception cwltool.command_line_tool.ParameterOutputWorkflowException(msg, port, **kwargs)

Bases: cwltool.errors.WorkflowException

Inheritance diagram of cwltool.command_line_tool.ParameterOutputWorkflowException

Common base class for all non-exit exceptions.

Parameters
  • msg (str) –

  • port (cwltool.utils.CWLObjectType) –

  • kwargs (Any) –

class cwltool.command_line_tool.CommandLineTool(toolpath_object, loadingContext)

Bases: cwltool.process.Process

Inheritance diagram of cwltool.command_line_tool.CommandLineTool

Base class for get_requirement().

Parameters
make_job_runner(self, runtimeContext)
Parameters

runtimeContext (cwltool.context.RuntimeContext) –

Return type

typing_extensions.Type[cwltool.job.JobBase]

make_path_mapper(self, reffiles, stagedir, runtimeContext, separateDirs)
Parameters
Return type

cwltool.pathmapper.PathMapper

updatePathmap(self, outdir, pathmap, fn)
Parameters
Return type

None

job(self, job_order, output_callbacks, runtimeContext)
Parameters
  • job_order (cwltool.utils.CWLObjectType) –

  • output_callbacks (Optional[cwltool.utils.OutputCallbackType]) –

  • runtimeContext (cwltool.context.RuntimeContext) –

Return type

Generator[Union[cwltool.job.JobBase, CallbackJob], None, None]

collect_output_ports(self, ports, builder, outdir, rcode, compute_checksum=True, jobname='', readers=None)
Parameters
  • ports (Union[ruamel.yaml.comments.CommentedSeq, Set[cwltool.utils.CWLObjectType]]) –

  • builder (cwltool.builder.Builder) –

  • outdir (str) –

  • rcode (int) –

  • compute_checksum (bool) –

  • jobname (str) –

  • readers (Optional[MutableMapping[str, cwltool.utils.CWLObjectType]]) –

Return type

OutputPortsType

collect_output(self, schema, builder, outdir, fs_access, compute_checksum=True)
Parameters
Return type

Optional[cwltool.utils.CWLOutputType]