Mercurial > repos > guerler > springsuite
comparison planemo/lib/python3.7/site-packages/galaxy/util/specs.py @ 1:56ad4e20f292 draft
"planemo upload commit 6eee67778febed82ddd413c3ca40b3183a3898f1"
author | guerler |
---|---|
date | Fri, 31 Jul 2020 00:32:28 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:d30785e31577 | 1:56ad4e20f292 |
---|---|
1 import functools | |
2 import operator | |
3 | |
4 from galaxy import util | |
5 | |
6 | |
7 # Utility methods for specifing maps. | |
8 def to_str_or_none(value): | |
9 if value is None: | |
10 return None | |
11 else: | |
12 return str(value) | |
13 | |
14 | |
15 def to_bool_or_none(value): | |
16 return util.string_as_bool_or_none(value) | |
17 | |
18 | |
19 def to_bool(value): | |
20 return util.asbool(value) | |
21 | |
22 | |
23 def to_float_or_none(value): | |
24 if value is None: | |
25 return None | |
26 else: | |
27 return float(value) | |
28 | |
29 | |
30 # Utility methods for specifing valid... | |
31 def is_in(*args): | |
32 return functools.partial(operator.contains, args) |