jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[cleanup] Replace deprecated pagegenerators.FileLinksGenerator with usingPages

pagegenerators.FileLinksGenerator is deprecated for 18 months.
Replaces their usage with FilePage.usingPages() method.

Change-Id: Ie9ce6290f189fe61891e2bdfedc9cf4ff3d92678
---
M scripts/image.py
M scripts/nowcommons.py
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/image.py b/scripts/image.py
index 0f875c8..bbeb82e 100755
--- a/scripts/image.py
+++ b/scripts/image.py
@@ -151,7 +151,7 @@
if old_image:
site = pywikibot.Site()
old_imagepage = pywikibot.FilePage(site, old_image)
- gen = pagegenerators.FileLinksGenerator(old_imagepage)
+ gen = old_imagepage.usingPages()
preloading_gen = pagegenerators.PreloadingGenerator(gen)
bot = ImageRobot(preloading_gen, old_image, new_image,
site=site, **options)
diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py
index ffed174..794f6de 100755
--- a/scripts/nowcommons.py
+++ b/scripts/nowcommons.py
@@ -292,7 +292,7 @@
local_file_page.title(with_ns=False),
commons_file_page.title(with_ns=False)))
bot = ImageBot(
- pg.FileLinksGenerator(local_file_page),
+ local_file_page.usingPages(),
local_file_page.title(with_ns=False),
commons_file_page.title(with_ns=False),
always=self.opt.replacealways,
@@ -305,7 +305,7 @@
page.title()).using_pages(total=1)))
if is_used and self.opt.replaceloose:
bot = ImageBot(
- pg.FileLinksGenerator(local_file_page),
+ local_file_page.usimgPages(),
local_file_page.title(with_ns=False,
as_url=True),
commons_file_page.title(with_ns=False),

To view, visit change 742189. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ie9ce6290f189fe61891e2bdfedc9cf4ff3d92678
Gerrit-Change-Number: 742189
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged