示例#1
0
def check_templates(page: pywikibot.Page) -> bool:
    """Returns true if page has no license tag and is not tagged for deletion"""
    default_skip = [
        "Template:Deletion_template_tag", "Template:License template tag"
    ]
    templates = {
        pywikibot.Page(site, title)
        for title in config.get("skip_templates", default_skip)
    }
    assert len(templates) >= 2
    page_templates = set(page.itertemplates())
    return page_templates.isdisjoint(templates)