Compare commits
No commits in common. "a3ed73a40d42db4bbc3032a296413d33b12eab99" and "d404568ff33916a6f1ad557f8752b83dd46fa55e" have entirely different histories.
a3ed73a40d
...
d404568ff3
|
|
@ -105,15 +105,6 @@ class SymbologyCache(Struct):
|
||||||
|
|
||||||
def write_config(self) -> None:
|
def write_config(self) -> None:
|
||||||
|
|
||||||
def clean_dict_for_toml(d):
|
|
||||||
'''Remove None values from dict recursively for TOML serialization'''
|
|
||||||
if isinstance(d, dict):
|
|
||||||
return {k: clean_dict_for_toml(v) for k, v in d.items() if v is not None}
|
|
||||||
elif isinstance(d, list):
|
|
||||||
return [clean_dict_for_toml(item) for item in d if item is not None]
|
|
||||||
else:
|
|
||||||
return d
|
|
||||||
|
|
||||||
# put the backend's pair-struct type ref at the top
|
# put the backend's pair-struct type ref at the top
|
||||||
# of file if possible.
|
# of file if possible.
|
||||||
cachedict: dict[str, Any] = {
|
cachedict: dict[str, Any] = {
|
||||||
|
|
@ -134,9 +125,7 @@ class SymbologyCache(Struct):
|
||||||
|
|
||||||
dct = cachedict[key] = {}
|
dct = cachedict[key] = {}
|
||||||
for key, struct in table.items():
|
for key, struct in table.items():
|
||||||
raw_dict = struct.to_dict(include_non_members=False)
|
dct[key] = struct.to_dict(include_non_members=False)
|
||||||
# Clean None values for TOML compatibility
|
|
||||||
dct[key] = clean_dict_for_toml(raw_dict)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with self.fp.open(mode='wb') as fp:
|
with self.fp.open(mode='wb') as fp:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue