summaryrefslogtreecommitdiff
path: root/find_archived_proposals_without_template.py
diff options
context:
space:
mode:
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()