Skip to content

Commit f854138

Browse files
committed
tool_init fix - guess datatype even if not using from_work_dir.
1 parent 39c8715 commit f854138

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

planemo/tool_builder.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,13 @@ def build(**kwds):
168168
for i, output_file in enumerate(example_outputs or []):
169169
name = "output%d" % (i + 1)
170170
from_path = output_file
171+
use_from_path = True
171172
if output_file in command:
172173
# Actually found the file in the command, assume it can
173174
# be specified directly and skip from_work_dir.
174-
from_path = None
175-
output = Output(name=name, from_path=from_path)
175+
use_from_path = False
176+
output = Output(name=name, from_path=from_path,
177+
use_from_path=use_from_path)
176178
outputs.append(output)
177179
test_case.outputs.append((name, output_file))
178180
command = _replace_file_in_command(command, output_file, output.name)
@@ -349,7 +351,7 @@ def __str__(self):
349351

350352
class Output(object):
351353

352-
def __init__(self, from_path=None, name=None):
354+
def __init__(self, from_path=None, name=None, use_from_path=False):
353355
if from_path:
354356
parts = from_path.split(".")
355357
name = name or parts[0]
@@ -363,7 +365,10 @@ def __init__(self, from_path=None, name=None):
363365

364366
self.name = name
365367
self.datatype = datatype
366-
self.from_path = from_path
368+
if use_from_path:
369+
self.from_path = from_path
370+
else:
371+
self.from_path = None
367372

368373
def __str__(self):
369374
if self.from_path:

0 commit comments

Comments
 (0)