jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/425548 )
Change subject: [FEAT] Show a warning if user does not exists on a given site ......................................................................
[FEAT] Show a warning if user does not exists on a given site
Also use any to set the default behavior
Bug: T191950 Change-Id: Ia6cac9f966c9dadde621dff6534bad25138ad9d7 --- M scripts/patrol.py 1 file changed, 8 insertions(+), 2 deletions(-)
Approvals: Zoranzoki21: Looks good to me, but someone else must approve Framawiki: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/patrol.py b/scripts/patrol.py index 659b76a..08f03c9 100755 --- a/scripts/patrol.py +++ b/scripts/patrol.py @@ -499,9 +499,15 @@ site.login()
if usercontribs: - pywikibot.output(u'Processing user: %s' % usercontribs) + user = pywikibot.User(site, usercontribs) + if user.isAnonymous() or user.isRegistered(): + pywikibot.output('Processing user: {}'.format(usercontribs)) + else: + pywikibot.warning('User {} does not exist on site {}.' + .format(usercontribs, site))
- if not newpages and not recentchanges and not usercontribs: + # default behaviour + if not any((newpages, recentchanges, usercontribs)): if site.family.name == 'wikipedia': newpages = True else:
pywikibot-commits@lists.wikimedia.org