cwltool.expression

Parse CWL expressions.

Module Contents

Functions

jshead(engine_config, rootvars)

scanner(scan)

next_seg(parsed_string, remaining_string, current_value)

evaluator(ex, jslib, obj, timeout, fullJS = False, force_docker_pull = False, debug = False, js_console = False, container_engine = 'docker')

interpolate(scan, rootvars, timeout = default_timeout, fullJS = False, jslib = '', force_docker_pull = False, debug = False, js_console = False, strip_whitespace = True, escaping_behavior = 2, convert_to_expression = False, container_engine = 'docker')

Interpolate and evaluate.

needs_parsing(snippet)

do_eval(ex, jobinput, requirements, outdir, tmpdir, resources, context = None, timeout = default_timeout, force_docker_pull = False, debug = False, js_console = False, strip_whitespace = True, cwlVersion = '', container_engine = 'docker')

Attributes

seg_symbol

seg_single

seg_double

seg_index

segments

segment_re

param_str

param_re

cwltool.expression.jshead(engine_config, rootvars)
Parameters
  • engine_config (List[str]) –

  • rootvars (cwltool.utils.CWLObjectType) –

Return type

str

cwltool.expression.seg_symbol = \w+
cwltool.expression.seg_single = \['([^']|\\')+'\]
cwltool.expression.seg_double = \["([^"]|\\")+"\]
cwltool.expression.seg_index = \[[0-9]+\]
cwltool.expression.segments
cwltool.expression.segment_re
cwltool.expression.param_str
cwltool.expression.param_re
exception cwltool.expression.SubstitutionError

Bases: Exception

Inheritance diagram of cwltool.expression.SubstitutionError

Common base class for all non-exit exceptions.

cwltool.expression.scanner(scan)
Parameters

scan (str) –

Return type

Optional[Tuple[int, int]]

cwltool.expression.next_seg(parsed_string, remaining_string, current_value)
Parameters
  • parsed_string (str) –

  • remaining_string (str) –

  • current_value (cwltool.utils.CWLOutputType) –

Return type

cwltool.utils.CWLOutputType

cwltool.expression.evaluator(ex, jslib, obj, timeout, fullJS=False, force_docker_pull=False, debug=False, js_console=False, container_engine='docker')
Parameters
  • ex (str) –

  • jslib (str) –

  • obj (cwltool.utils.CWLObjectType) –

  • timeout (float) –

  • fullJS (bool) –

  • force_docker_pull (bool) –

  • debug (bool) –

  • js_console (bool) –

  • container_engine (str) –

Return type

Optional[cwltool.utils.CWLOutputType]

cwltool.expression.interpolate(scan, rootvars, timeout=default_timeout, fullJS=False, jslib='', force_docker_pull=False, debug=False, js_console=False, strip_whitespace=True, escaping_behavior=2, convert_to_expression=False, container_engine='docker')

Interpolate and evaluate.

Note: only call with convert_to_expression=True on CWL Expressions in $() form that need interpolation.

Parameters
  • scan (str) –

  • rootvars (cwltool.utils.CWLObjectType) –

  • timeout (float) –

  • fullJS (bool) –

  • jslib (str) –

  • force_docker_pull (bool) –

  • debug (bool) –

  • js_console (bool) –

  • strip_whitespace (bool) –

  • escaping_behavior (int) –

  • convert_to_expression (bool) –

  • container_engine (str) –

Return type

Optional[cwltool.utils.CWLOutputType]

cwltool.expression.needs_parsing(snippet)
Parameters

snippet (Any) –

Return type

bool

cwltool.expression.do_eval(ex, jobinput, requirements, outdir, tmpdir, resources, context=None, timeout=default_timeout, force_docker_pull=False, debug=False, js_console=False, strip_whitespace=True, cwlVersion='', container_engine='docker')
Parameters
  • ex (Optional[cwltool.utils.CWLOutputType]) –

  • jobinput (cwltool.utils.CWLObjectType) –

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

  • outdir (Optional[str]) –

  • tmpdir (Optional[str]) –

  • resources (Dict[str, Union[float, int]]) –

  • context (Optional[cwltool.utils.CWLOutputType]) –

  • timeout (float) –

  • force_docker_pull (bool) –

  • debug (bool) –

  • js_console (bool) –

  • strip_whitespace (bool) –

  • cwlVersion (str) –

  • container_engine (str) –

Return type

Optional[cwltool.utils.CWLOutputType]