From e7004a08f40bc10bf4d14589de685d4beb05a6f9 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Thu, 9 Nov 2023 07:39:16 +0100 Subject: [PATCH] Remove unused code --- depicts/mediawiki.py | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/depicts/mediawiki.py b/depicts/mediawiki.py index d6fc761..4331bc7 100644 --- a/depicts/mediawiki.py +++ b/depicts/mediawiki.py @@ -8,7 +8,6 @@ import typing import requests from . import utils -from .category import Category from .type import CallParams, Entity wikidata_url = "https://www.wikidata.org/w/api.php" @@ -200,30 +199,6 @@ def host_from_site(site: str) -> str: return hosts[site] -def process_cats(cats: list[dict[str, str]], site: str) -> list[Category]: - """Process categories.""" - return [Category(cat["title"], site) for cat in cats] - - -def get_categories(titles: list[str], site: str) -> list[tuple[str, list[Category]]]: - """Get categories for pages with given titles.""" - params: CallParams = { - "prop": "categories", - "clshow": "!hidden", - "cllimit": "max", - } - from_wiki = mediawiki_query(titles, params, site) - title_and_cats = [] - for i in from_wiki: - if "categories" not in i: - continue - cats = process_cats(i["categories"], site) - if not cats: - continue - title_and_cats.append((i["title"], cats)) - return title_and_cats - - def get_history(title: str, site: str) -> list[Page]: """Get history of a page.""" params: CallParams = {