HomePhabricator

[IMPR] newitem.py: ignore pages with {{delete}} templates

Description

[IMPR] newitem.py: ignore pages with {{delete}} templates

  • DELETION_TEMPLATES hold all WD items for deletion templates
  • introduce _skipping_templates attribute which holds all deletion templates including redirects for each site. This enable newitem.py to be a MultipleSites bot.
  • derive NewItemRobot from NoRedirectPageBot which skips redirects
  • move all skipping conditions to skip_page method
  • retrieve all skipping templates in get_skipping_templates method and store the result as a set in _skipping_templates dict for each site
  • skip_templates method checks for each template of a page if it is in a skipping template and return it's title. skip_page method uses this title for printing a message
  • split initializer and move setting up pageAgeBefore and lastEditBefore attributes to setup method

Bug: T256676
Change-Id: If7c36813606a89e11f17773611ec69fe080d62ca

Details

Provenance
XqtAuthored on Jun 30 2020, 3:58 PM
Parents
rPWBC74ecd56daeb4: Merge "[bugfix] escape delete char 127 in UnicodeToAsciiHtml function"
Branches
Unknown
Tags
Unknown
ChangeId
If7c36813606a89e11f17773611ec69fe080d62ca