jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/742189 )
Change subject: [cleanup] Replace deprecated pagegenerators.FileLinksGenerator with usingPages ......................................................................
[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(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
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),
pywikibot-commits@lists.wikimedia.org