Skip to content

Commit

Permalink
fix BoboTiG#1494: Smarter link-with-namespace filter
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Jan 17, 2023
1 parent 298b2d2 commit e052914
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 389 deletions.
7 changes: 4 additions & 3 deletions scripts/all-namespaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
locales = ("ca", "de", "el", "en", "es", "fr", "it", "no", "pt", "ru", "sv")

for locale in locales:
result_array: List[str] = []
result_discard_last: List[str] = []
langurl = url.format(locale)
r = requests.get(langurl)
json = r.json()
namespaces = json["query"]["namespaces"]
for key, namespace in namespaces.items():
if n := namespace["*"]:
result_array.append(n)
results[locale] = sorted(result_array)
if namespace["canonical"] in ["File", "Category"]:
result_discard_last.append(n)
results[locale] = result_discard_last

print("namespaces =", end=" ")
print(results)
Loading

0 comments on commit e052914

Please sign in to comment.