Post code-cleanup

This commit is contained in:
lwark
2025-01-21 15:18:37 -06:00
parent bf711369c6
commit bc4af61f5f
26 changed files with 546 additions and 377 deletions

View File

@@ -158,12 +158,15 @@ class InfoWriter(object):
match k:
case "custom":
continue
# case "comment":
# NOTE: merge all comments to fit in single cell.
if k == "comment" and isinstance(v['value'], list):
json_join = [item['text'] for item in v['value'] if 'text' in item.keys()]
v['value'] = "\n".join(json_join)
case "comment":
# NOTE: merge all comments to fit in single cell.
if isinstance(v['value'], list):
json_join = [item['text'] for item in v['value'] if 'text' in item.keys()]
v['value'] = "\n".join(json_join)
case thing if thing in self.sub_object.timestamps:
v['value'] = v['value'].date()
case _:
pass
final_info[k] = v
try:
locations = v['locations']
@@ -252,6 +255,11 @@ class ReagentWriter(object):
for v in reagent.values():
if not isinstance(v, dict):
continue
match v['value']:
case datetime():
v['value'] = v['value'].date()
case _:
pass
sheet.cell(row=v['row'], column=v['column'], value=v['value'])
return self.xl