comparison env/lib/python3.9/site-packages/galaxy/util/specs.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
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)