Allow purging groups of messages
This commit is contained in:
parent
b165722c58
commit
25fdf65788
1 changed files with 5 additions and 5 deletions
10
purge.py
10
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}.")
|
||||
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