allow 'none' to omit a value
This commit is contained in:
parent
a739ce985c
commit
745bbf6144
1 changed files with 3 additions and 1 deletions
4
k2t.py
4
k2t.py
|
|
@ -174,10 +174,12 @@ class Entry:
|
|||
|
||||
tag = field.name.replace('_', '-')
|
||||
el2 = ElementTree.Element(tag)
|
||||
|
||||
if val is not None:
|
||||
if not isinstance(val, str):
|
||||
val = str(val).lower()
|
||||
el2.text = val
|
||||
if val != 'none':
|
||||
el2.text = val
|
||||
elif tag == 'source':
|
||||
el2.text = '*/*@*'
|
||||
el.append(el2)
|
||||
|
|
|
|||
Loading…
Reference in a new issue