comparison env/lib/python3.7/site-packages/galaxy/util/specs.py @ 2:6af9afd405e9 draft

"planemo upload commit 0a63dd5f4d38a1f6944587f52a8cd79874177fc1"
author shellac
date Thu, 14 May 2020 14:56:58 -0400
parents 26e78fe6e8c4
children
comparison
equal deleted inserted replaced
1:75ca89e9b81c 2:6af9afd405e9
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)