fix in cases where a category doesn't already exist
This commit is contained in:
parent
6c1bcc09d3
commit
3e0a4a9da2
4
k2t.py
4
k2t.py
@ -76,6 +76,10 @@ def t2k(tfile: str, kfile: str) -> None:
|
|||||||
with open(tfile, 'rb') as ff:
|
with open(tfile, 'rb') as ff:
|
||||||
ttree = tomllib.load(ff)
|
ttree = tomllib.load(ff)
|
||||||
|
|
||||||
|
ttree.setdefault('layers', [])
|
||||||
|
ttree.setdefault('patterns', [])
|
||||||
|
ttree.setdefault('linestyles', [])
|
||||||
|
|
||||||
entries = [Entry.from_toml(entry)
|
entries = [Entry.from_toml(entry)
|
||||||
for entry in ttree['layers']]
|
for entry in ttree['layers']]
|
||||||
patterns = [Pattern.from_toml(pat)
|
patterns = [Pattern.from_toml(pat)
|
||||||
|
Loading…
Reference in New Issue
Block a user