comparison env/lib/python3.7/site-packages/galaxy/util/specs.py @ 5:9b1c78e6ba9c draft default tip

"planemo upload commit 6c0a8142489327ece472c84e558c47da711a9142"
author shellac
date Mon, 01 Jun 2020 08:59:25 -0400
parents 79f47841a781
children
comparison
equal deleted inserted replaced
4:79f47841a781 5:9b1c78e6ba9c
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)