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