From 85e2cea63af8300af62575d3a7d4b0458cca53f6 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sun, 9 Mar 2025 10:59:17 +0100 Subject: refactor: introduce run methods --- find_archived_proposals_without_template.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'find_archived_proposals_without_template.py') diff --git a/find_archived_proposals_without_template.py b/find_archived_proposals_without_template.py index 0acb4bf..50dbbd9 100755 --- a/find_archived_proposals_without_template.py +++ b/find_archived_proposals_without_template.py @@ -10,14 +10,20 @@ import mwparserfromhell OSMWIKI_ENDPOINT = 'https://wiki.openstreetmap.org/w/api.php' -osmwiki = pywikiapi.Site(OSMWIKI_ENDPOINT) -for page in osmwiki.query_pages( - generator='categorymembers', - gcmtitle='Category:Archived proposals', - gcmlimit='max', - prop='templates', - tltemplates='Template:Proposal page' -): - if not 'templates' in page: - print(page['title']) +def run(): + osmwiki = pywikiapi.Site(OSMWIKI_ENDPOINT) + + for page in osmwiki.query_pages( + generator='categorymembers', + gcmtitle='Category:Archived proposals', + gcmlimit='max', + prop='templates', + tltemplates='Template:Proposal page', + ): + if not 'templates' in page: + print(page['title']) + + +if __name__ == "__main__": + run() -- cgit v1.2.3