Skip to content

Commit

Permalink
Rename loadListing enum (#349)
Browse files Browse the repository at this point in the history
* Rename loadListing enum: no_listing, shallow_listing, deep_listing.
  • Loading branch information
tetron authored Mar 27, 2017
1 parent 9a4b7b1 commit bbc20e1
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
10 changes: 5 additions & 5 deletions cwltool/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cwltool/draft2tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down
3 changes: 1 addition & 2 deletions cwltool/extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ $graph:
"_type": "@vocab"
loadListing:
type:
- "null"
- type: enum
name: LoadListingEnum
symbols: [shallow, deep]
symbols: [no_listing, shallow_listing, deep_listing]
2 changes: 1 addition & 1 deletion tests/wf/listing_deep.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $namespaces:
cwltool: "http://commonwl.org/cwltool#"
requirements:
cwltool:LoadListingRequirement:
loadListing: deep
loadListing: deep_listing
inputs:
d: Directory
outputs: []
Expand Down
2 changes: 1 addition & 1 deletion tests/wf/listing_none.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $namespaces:
cwltool: http://commonwl.org/cwltool#
requirements:
cwltool:LoadListingRequirement:
loadListing: null
loadListing: no_listing
inputs:
d: Directory
outputs: []
Expand Down
2 changes: 1 addition & 1 deletion tests/wf/listing_shallow.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $namespaces:
cwltool: http://commonwl.org/cwltool#
requirements:
cwltool:LoadListingRequirement:
loadListing: shallow
loadListing: shallow_listing
inputs:
d: Directory
outputs: []
Expand Down

0 comments on commit bbc20e1

Please sign in to comment.