allow 'none' to omit a value
This commit is contained in:
parent
a739ce985c
commit
745bbf6144
1 changed files with 3 additions and 1 deletions
2
k2t.py
2
k2t.py
|
|
@ -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 = '*/*@*'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue