summaryrefslogtreecommitdiff
path: root/find_archived_proposals_without_template.py
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2025-03-09 10:59:17 +0100
committerMartin Fischer <martin@push-f.com>2025-03-09 10:59:17 +0100
commit85e2cea63af8300af62575d3a7d4b0458cca53f6 (patch)
treec104e2a6755ee894d71e1055eed7e85ded7adeb2 /find_archived_proposals_without_template.py
parent1677f3986df69b5600c5986f31534af2fa693ea3 (diff)
refactor: introduce run methods
Diffstat (limited to 'find_archived_proposals_without_template.py')
-rwxr-xr-xfind_archived_proposals_without_template.py26
1 files changed, 16 insertions, 10 deletions
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()