File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 1
1
""" Click definitions for various shared options and arguments.
2
2
"""
3
+
4
+ import os
5
+
3
6
import click
4
7
from galaxy .tools .deps import docker_util
5
8
@@ -142,6 +145,13 @@ def required_tool_arg():
142
145
return click .argument ('path' , metavar = "TOOL_PATH" , type = arg_type )
143
146
144
147
148
+ def _optional_tools_default (ctx , param , value ):
149
+ if param .name == "paths" and len (value ) == 0 :
150
+ return [os .path .abspath (os .getcwd ())]
151
+ else :
152
+ return value
153
+
154
+
145
155
def optional_tools_arg (multiple = False ):
146
156
""" Decorate click method as optionally taking in the path to a tool
147
157
or directory of tools. If no such argument is given the current working
@@ -159,9 +169,9 @@ def optional_tools_arg(multiple=False):
159
169
return click .argument (
160
170
name ,
161
171
metavar = "TOOL_PATH" ,
162
- default = "." ,
163
172
type = arg_type ,
164
173
nargs = nargs ,
174
+ callback = _optional_tools_default ,
165
175
)
166
176
167
177
Original file line number Diff line number Diff line change 4
4
cat $input1 #for $q in $queries# ${q.input2} #end for# > $out_file1
5
5
</command >
6
6
<inputs >
7
- <param name =" input1" type =" data" label =" Concatenate Dataset" />
7
+ <param name =" input1" type =" data" label =" Concatenate Dataset" format = " data " />
8
8
<repeat name =" queries" title =" Dataset" >
9
- <param name =" input2" type =" data" label =" Select" />
9
+ <param name =" input2" type =" data" label =" Select" format = " data " />
10
10
</repeat >
11
11
</inputs >
12
12
<outputs >
13
- <data name =" out_file1" format = " input " metadata_source =" input1" />
13
+ <data name =" out_file1" format_source = " input1 " metadata_source =" input1" />
14
14
</outputs >
15
15
<tests >
16
16
<test >
19
19
</test >
20
20
</tests >
21
21
<help >
22
+ Concatenate datasets.
22
23
</help >
23
24
</tool >
Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ def test_fail_tools(self):
22
22
lint_cmd = ["lint" , fail_tool ]
23
23
self ._check_exit_code (lint_cmd , exit_code = 1 )
24
24
25
+ def test_lint_default (self ):
26
+ with self ._isolate_repo ("single_tool" ):
27
+ self ._check_exit_code (["lint" , "--skip" , "citations" ])
28
+ with self ._isolate_repo ("single_tool" ):
29
+ self ._check_exit_code (["lint" ], exit_code = 1 )
30
+
25
31
def test_lint_multiple (self ):
26
32
names = ["fail_citation.xml" , "fail_order.xml" ]
27
33
paths = list (map (lambda p : os .path .join (TEST_TOOLS_DIR , p ), names ))
You can’t perform that action at this time.
0 commit comments