2 Miscellaneous, more refined type casting functions
5 def unicode_or_none(value):
7 Convert value to unicode if its not none.
14 def parse_flowcell_id(flowcell_id):
16 Return flowcell id and any status encoded in the id
18 We stored the status information in the flowcell id name.
19 this was dumb, but database schemas are hard to update.
21 fields = flowcell_id.split()
30 def parse_slice(slice_text):
31 if slice_text is None or len(slice_text) == 0:
35 for element in slice_text.split(':'):
39 element = int(element)
40 slice_data.append(element)
42 return slice(*slice_data)