jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] PageTitleFilterPageGenerator: docstring more specific ......................................................................
[IMPROV] PageTitleFilterPageGenerator: docstring more specific
The docstring explicitly says that the titles need to be regexable strings. Also simplified the test if there is an entry for family/code in ignore_list.
Change-Id: I1ef136bcd6d9d1cd2d891024b85dfed414b83eef --- M pywikibot/pagegenerators.py 1 file changed, 4 insertions(+), 4 deletions(-)
Approvals: Nullzero: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index fab7ccd..28c4136 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -923,14 +923,14 @@ """ Yield only those pages are not listed in the ignore list.
- @param ignore_list: family names are mapped to dictionaries - in which language codes are mapped to lists of page titles + @param ignore_list: family names are mapped to dictionaries in which + language codes are mapped to lists of page titles. Each title must + be a valid regex as they are compared using L{re.search}. @type ignore_list: dict
""" def is_ignored(page): - if page.site.family.name in ignore_list and \ - page.site.code in ignore_list[page.site.family.name]: + if page.site.code in ignore_list.get(page.site.family.name, {}): for ig in ignore_list[page.site.family.name][page.site.code]: if re.search(ig, page.title()): return True