[MediaWiki-commits] [Gerrit] [IMPROV] nowcommons: Query at most one users - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [IMPROV] nowcommons: Query at most one users .. [IMPROV] nowcommons: Query at most one users To verify if a page is used it's only necessary to query one using page instead of all. Conflicts: scripts/nowcommons.py Change-Id: I9bbb206ede1723c33410c3b50e05dae71ecc265f --- M scripts/nowcommons.py 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py index b462ec7..3e4e5b7 100755 --- a/scripts/nowcommons.py +++ b/scripts/nowcommons.py @@ -369,9 +369,9 @@ oImageRobot.run() # If the image is used with the urlname the # previous function won't work -if len(list(pywikibot.FilePage(self.site, - page.title()).usingPages())) > 0 and \ - self.getOption('replaceloose'): +is_used = bool(list(pywikibot.FilePage( +self.site, page.title()).usingPages(total=1))) +if is_used and self.getOption('replaceloose'): oImageRobot = image.ImageRobot( pg.FileLinksGenerator( localImagePage), -- To view, visit https://gerrit.wikimedia.org/r/243507 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9bbb206ede1723c33410c3b50e05dae71ecc265f Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: 2.0 Gerrit-Owner: Merlijn van DeenGerrit-Reviewer: John Vandenberg Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: XZise Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [IMPROV] nowcommons: Query at most one users - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/243507 Change subject: [IMPROV] nowcommons: Query at most one users .. [IMPROV] nowcommons: Query at most one users To verify if a page is used it's only necessary to query one using page instead of all. Conflicts: scripts/nowcommons.py Change-Id: I9bbb206ede1723c33410c3b50e05dae71ecc265f --- M scripts/nowcommons.py 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/07/243507/1 diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py index b462ec7..3e4e5b7 100755 --- a/scripts/nowcommons.py +++ b/scripts/nowcommons.py @@ -369,9 +369,9 @@ oImageRobot.run() # If the image is used with the urlname the # previous function won't work -if len(list(pywikibot.FilePage(self.site, - page.title()).usingPages())) > 0 and \ - self.getOption('replaceloose'): +is_used = bool(list(pywikibot.FilePage( +self.site, page.title()).usingPages(total=1))) +if is_used and self.getOption('replaceloose'): oImageRobot = image.ImageRobot( pg.FileLinksGenerator( localImagePage), -- To view, visit https://gerrit.wikimedia.org/r/243507 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9bbb206ede1723c33410c3b50e05dae71ecc265f Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: 2.0 Gerrit-Owner: Merlijn van DeenGerrit-Reviewer: XZise ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [IMPROV] nowcommons: Query at most one users - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [IMPROV] nowcommons: Query at most one users .. [IMPROV] nowcommons: Query at most one users To verify if a page is used it's only necessary to query one using page instead of all. Change-Id: I9bbb206ede1723c33410c3b50e05dae71ecc265f --- M scripts/nowcommons.py 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py index cfd9d0b..433dd9c 100755 --- a/scripts/nowcommons.py +++ b/scripts/nowcommons.py @@ -374,9 +374,9 @@ bot.run() # If the image is used with the urlname the # previous function won't work -if len(list(pywikibot.FilePage(self.site, - page.title()).usingPages())) > 0 and \ - self.getOption('replaceloose'): +is_used = bool(list(pywikibot.FilePage( +self.site, page.title()).usingPages(total=1))) +if is_used and self.getOption('replaceloose'): bot = ImageBot( pg.FileLinksGenerator( localImagePage), -- To view, visit https://gerrit.wikimedia.org/r/240359 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9bbb206ede1723c33410c3b50e05dae71ecc265f Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZiseGerrit-Reviewer: John Vandenberg Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [IMPROV] nowcommons: Query at most one users - change (pywikibot/core)
XZise has uploaded a new change for review. https://gerrit.wikimedia.org/r/240359 Change subject: [IMPROV] nowcommons: Query at most one users .. [IMPROV] nowcommons: Query at most one users To verify if a page is used it's only necessary to query one using page instead of all. Change-Id: I9bbb206ede1723c33410c3b50e05dae71ecc265f --- M scripts/nowcommons.py 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/59/240359/1 diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py index cfd9d0b..433dd9c 100755 --- a/scripts/nowcommons.py +++ b/scripts/nowcommons.py @@ -374,9 +374,9 @@ bot.run() # If the image is used with the urlname the # previous function won't work -if len(list(pywikibot.FilePage(self.site, - page.title()).usingPages())) > 0 and \ - self.getOption('replaceloose'): +is_used = bool(list(pywikibot.FilePage( +self.site, page.title()).usingPages(total=1))) +if is_used and self.getOption('replaceloose'): bot = ImageBot( pg.FileLinksGenerator( localImagePage), -- To view, visit https://gerrit.wikimedia.org/r/240359 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9bbb206ede1723c33410c3b50e05dae71ecc265f Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits