diff options
-rwxr-xr-x | proposals.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/proposals.py b/proposals.py index 66c5b1b..356ceba 100755 --- a/proposals.py +++ b/proposals.py @@ -43,20 +43,22 @@ def get_template_val(tpl, name): proposals = [] for page in find_proposals(): + page_title = page['title'] text = page['revisions'][0]['slots']['main']['content'] doc = mwparserfromhell.parse(text) - templates = doc.filter_templates(matches=lambda t: t.name.matches('Proposal Page')) + proposal_page_templates = doc.filter_templates( + matches=lambda t: t.name.matches('Proposal Page') + ) - if not templates: - print('{{Proposal Page}} not found in ', page['title'], file=sys.stderr) + if not proposal_page_templates: + print('{{Proposal Page}} not found in', page_title, file=sys.stderr) continue for comment in doc.ifilter_comments(): # remove comments like <!-- Date the RFC email is sent to the Tagging list: YYYY-MM-DD --> doc.remove(comment) - tpl = templates[0] - page_title = page['title'] + tpl = proposal_page_templates[0] name = get_template_val(tpl, 'name') if name: |