Skip to content

Commit ac83d54

Browse files
committed
Provide ability to leave default input values unquoted if a string
1 parent 1d91572 commit ac83d54

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

wdlgen/common.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55

66

77
class Input(WdlBase):
8-
def __init__(self, data_type: WdlType, name: str, expression: str = None):
8+
def __init__(self, data_type: WdlType, name: str, expression: str = None, requires_quotes=True):
99
self.type = data_type
1010
self.name = name
1111
self.expression = expression
12+
self.requires_quotes = requires_quotes
1213

1314
self.format = "{type} {name}{def_w_equals}"
1415

@@ -23,7 +24,10 @@ def get_string(self):
2324

2425
def get_string_from_type(self, wdtype):
2526
expression = self.expression
26-
requires_quotes = not (expression is None or isinstance(expression, bool) or isinstance(expression, int) or isinstance(expression, float))
27+
requires_quotes = self.requires_quotes and not (expression is None or
28+
isinstance(expression, bool) or
29+
isinstance(expression, int) or
30+
isinstance(expression, float))
2731

2832
if isinstance(expression, bool):
2933
expression = "true" if expression else "false"

0 commit comments

Comments
 (0)