From bbc20e1cfe495ba85f13527dd10a4e374611fa2a Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Mon, 27 Mar 2017 10:36:22 -0400 Subject: [PATCH] Rename loadListing enum (#349) * Rename loadListing enum: no_listing, shallow_listing, deep_listing. --- cwltool/builder.py | 10 +++++----- cwltool/draft2tool.py | 4 ++-- cwltool/extensions.yml | 3 +-- tests/wf/listing_deep.cwl | 2 +- tests/wf/listing_none.cwl | 2 +- tests/wf/listing_shallow.cwl | 2 +- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/cwltool/builder.py b/cwltool/builder.py index 88d5d42ed..6494f5dca 100644 --- a/cwltool/builder.py +++ b/cwltool/builder.py @@ -42,9 +42,9 @@ def __init__(self): # type: () -> None self.build_job_script = None # type: Callable[[List[str]], Text] self.debug = False # type: bool - # One of None, "shallow", "deep" - # Will be default None for CWL v1.1 - self.loadListing = "deep" # type: Union[None, str] + # One of "no_listing", "shallow_listing", "deep_listing" + # Will be default "no_listing" for CWL v1.1 + self.loadListing = "deep_listing" # type: Union[None, str] def bind_input(self, schema, datum, lead_pos=None, tail_pos=None): # type: (Dict[Text, Any], Any, Union[int, List[int]], List[int]) -> List[Dict[Text, Any]] @@ -148,8 +148,8 @@ def _capture_files(f): if schema["type"] == "Directory": ll = self.loadListing or (binding and binding.get("loadListing")) - if ll: - get_listing(self.fs_access, datum, (ll == "deep")) + if ll and ll != "no_listing": + get_listing(self.fs_access, datum, (ll == "deep_listing")) self.files.append(datum) # Position to front of the sort key diff --git a/cwltool/draft2tool.py b/cwltool/draft2tool.py index 3a8d6be58..ecff70314 100644 --- a/cwltool/draft2tool.py +++ b/cwltool/draft2tool.py @@ -471,8 +471,8 @@ def collect_output(self, schema, builder, outdir, fs_access, compute_checksum=Tr for files in r: if files["class"] == "Directory": ll = builder.loadListing or (binding and binding.get("loadListing")) - if ll: - get_listing(fs_access, files, (ll == "deep")) + if ll and ll != "no_listing": + get_listing(fs_access, files, (ll == "deep_listing")) else: with fs_access.open(files["location"], "rb") as f: contents = "" diff --git a/cwltool/extensions.yml b/cwltool/extensions.yml index 95af9b043..e0b0dadf7 100644 --- a/cwltool/extensions.yml +++ b/cwltool/extensions.yml @@ -17,7 +17,6 @@ $graph: "_type": "@vocab" loadListing: type: - - "null" - type: enum name: LoadListingEnum - symbols: [shallow, deep] \ No newline at end of file + symbols: [no_listing, shallow_listing, deep_listing] \ No newline at end of file diff --git a/tests/wf/listing_deep.cwl b/tests/wf/listing_deep.cwl index 55e8e1228..62bff5c3f 100644 --- a/tests/wf/listing_deep.cwl +++ b/tests/wf/listing_deep.cwl @@ -4,7 +4,7 @@ $namespaces: cwltool: "http://commonwl.org/cwltool#" requirements: cwltool:LoadListingRequirement: - loadListing: deep + loadListing: deep_listing inputs: d: Directory outputs: [] diff --git a/tests/wf/listing_none.cwl b/tests/wf/listing_none.cwl index 010a887d6..9e2a51130 100644 --- a/tests/wf/listing_none.cwl +++ b/tests/wf/listing_none.cwl @@ -4,7 +4,7 @@ $namespaces: cwltool: http://commonwl.org/cwltool# requirements: cwltool:LoadListingRequirement: - loadListing: null + loadListing: no_listing inputs: d: Directory outputs: [] diff --git a/tests/wf/listing_shallow.cwl b/tests/wf/listing_shallow.cwl index 11343d6dc..6e2b56972 100644 --- a/tests/wf/listing_shallow.cwl +++ b/tests/wf/listing_shallow.cwl @@ -4,7 +4,7 @@ $namespaces: cwltool: http://commonwl.org/cwltool# requirements: cwltool:LoadListingRequirement: - loadListing: shallow + loadListing: shallow_listing inputs: d: Directory outputs: []