2 Miscellaneous, more refined type casting functions
4 from __future__ import unicode_literals
6 def str_or_none(value):
8 Convert value to unicode string if its not none.
15 def parse_flowcell_id(flowcell_id):
17 Return flowcell id and any status encoded in the id
19 We stored the status information in the flowcell id name.
20 this was dumb, but database schemas are hard to update.
22 fields = flowcell_id.split()
31 def parse_slice(slice_text):
32 if slice_text is None or len(slice_text) == 0:
36 for element in slice_text.split(':'):
40 element = int(element)
41 slice_data.append(element)
43 return slice(*slice_data)