Skip to content

Commit bbc20e1

Browse files
authored
Rename loadListing enum (#349)
* Rename loadListing enum: no_listing, shallow_listing, deep_listing.
1 parent 9a4b7b1 commit bbc20e1

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

cwltool/builder.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def __init__(self): # type: () -> None
4242
self.build_job_script = None # type: Callable[[List[str]], Text]
4343
self.debug = False # type: bool
4444

45-
# One of None, "shallow", "deep"
46-
# Will be default None for CWL v1.1
47-
self.loadListing = "deep" # type: Union[None, str]
45+
# One of "no_listing", "shallow_listing", "deep_listing"
46+
# Will be default "no_listing" for CWL v1.1
47+
self.loadListing = "deep_listing" # type: Union[None, str]
4848

4949
def bind_input(self, schema, datum, lead_pos=None, tail_pos=None):
5050
# type: (Dict[Text, Any], Any, Union[int, List[int]], List[int]) -> List[Dict[Text, Any]]
@@ -148,8 +148,8 @@ def _capture_files(f):
148148

149149
if schema["type"] == "Directory":
150150
ll = self.loadListing or (binding and binding.get("loadListing"))
151-
if ll:
152-
get_listing(self.fs_access, datum, (ll == "deep"))
151+
if ll and ll != "no_listing":
152+
get_listing(self.fs_access, datum, (ll == "deep_listing"))
153153
self.files.append(datum)
154154

155155
# Position to front of the sort key

cwltool/draft2tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,8 @@ def collect_output(self, schema, builder, outdir, fs_access, compute_checksum=Tr
471471
for files in r:
472472
if files["class"] == "Directory":
473473
ll = builder.loadListing or (binding and binding.get("loadListing"))
474-
if ll:
475-
get_listing(fs_access, files, (ll == "deep"))
474+
if ll and ll != "no_listing":
475+
get_listing(fs_access, files, (ll == "deep_listing"))
476476
else:
477477
with fs_access.open(files["location"], "rb") as f:
478478
contents = ""

cwltool/extensions.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ $graph:
1717
"_type": "@vocab"
1818
loadListing:
1919
type:
20-
- "null"
2120
- type: enum
2221
name: LoadListingEnum
23-
symbols: [shallow, deep]
22+
symbols: [no_listing, shallow_listing, deep_listing]

tests/wf/listing_deep.cwl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $namespaces:
44
cwltool: "http://commonwl.org/cwltool#"
55
requirements:
66
cwltool:LoadListingRequirement:
7-
loadListing: deep
7+
loadListing: deep_listing
88
inputs:
99
d: Directory
1010
outputs: []

tests/wf/listing_none.cwl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $namespaces:
44
cwltool: http://commonwl.org/cwltool#
55
requirements:
66
cwltool:LoadListingRequirement:
7-
loadListing: null
7+
loadListing: no_listing
88
inputs:
99
d: Directory
1010
outputs: []

tests/wf/listing_shallow.cwl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $namespaces:
44
cwltool: http://commonwl.org/cwltool#
55
requirements:
66
cwltool:LoadListingRequirement:
7-
loadListing: shallow
7+
loadListing: shallow_listing
88
inputs:
99
d: Directory
1010
outputs: []

0 commit comments

Comments
 (0)