Mercurial > repos > shellac > guppy_basecaller
comparison env/lib/python3.7/site-packages/galaxy/util/specs.py @ 0:26e78fe6e8c4 draft
"planemo upload commit c699937486c35866861690329de38ec1a5d9f783"
| author | shellac |
|---|---|
| date | Sat, 02 May 2020 07:14:21 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:26e78fe6e8c4 |
|---|---|
| 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) |
