Allow purging groups of messages
This commit is contained in:
parent
b165722c58
commit
fedc6d213e
1 changed files with 3 additions and 3 deletions
4
purge.py
4
purge.py
|
@ -30,15 +30,15 @@ def walk_and_discard(obj, prefix):
|
||||||
result = {}
|
result = {}
|
||||||
for k, v in obj.items():
|
for k, v in obj.items():
|
||||||
fqkey = f"{prefix}{k}"
|
fqkey = f"{prefix}{k}"
|
||||||
if isinstance(v, str):
|
|
||||||
if fqkey not in to_discard:
|
if fqkey not in to_discard:
|
||||||
|
if isinstance(v, str):
|
||||||
result[k] = v
|
result[k] = v
|
||||||
elif hasattr(v, "items"):
|
elif hasattr(v, "items"):
|
||||||
result[k] = walk_and_discard(v, f"{prefix}{k}.")
|
result[k] = walk_and_discard(v, f"{prefix}{k}.")
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
path_langs = os.path.join(path_mc_repo, "langs")
|
path_langs = os.path.join(path_mc_repo, "langs/layers")
|
||||||
json_files = [
|
json_files = [
|
||||||
f for f in os.listdir(path_langs)
|
f for f in os.listdir(path_langs)
|
||||||
if os.path.isfile(os.path.join(path_langs, f)) and f.endswith(".json")
|
if os.path.isfile(os.path.join(path_langs, f)) and f.endswith(".json")
|
||||||
|
|
Loading…
Reference in a new issue