allow 'none' to omit a value

This commit is contained in:
Jan Petykiewicz 2026-11-23 12:18:14 -08:00
commit 745bbf6144

2
k2t.py
View file

@ -174,9 +174,11 @@ class Entry:
tag = field.name.replace('_', '-') tag = field.name.replace('_', '-')
el2 = ElementTree.Element(tag) el2 = ElementTree.Element(tag)
if val is not None: if val is not None:
if not isinstance(val, str): if not isinstance(val, str):
val = str(val).lower() val = str(val).lower()
if val != 'none':
el2.text = val el2.text = val
elif tag == 'source': elif tag == 'source':
el2.text = '*/*@*' el2.text = '*/*@*'