OdysseasKr has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316060

Change subject: Silence warnings
......................................................................

Silence warnings

Set value of self.site before refering to it

Bug: T146580
Change-Id: I60f757a9281810453caea66f6a50a9200765a439
---
M scripts/image.py
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/60/316060/1

diff --git a/scripts/image.py b/scripts/image.py
index 59464b0..ff8517c 100755
--- a/scripts/image.py
+++ b/scripts/image.py
@@ -58,7 +58,7 @@
 
     """This bot will replace or remove all occurrences of an old image."""
 
-    def __init__(self, generator, old_image, new_image=None, **kwargs):
+    def __init__(self, generator, site, old_image, new_image=None, **kwargs):
         """
         Constructor.
 
@@ -77,6 +77,7 @@
 
         Bot.__init__(self, generator=generator, **kwargs)
 
+       self.site = site
         self.old_image = old_image
         self.new_image = new_image
         param = {
@@ -157,6 +158,7 @@
         gen = pagegenerators.FileLinksGenerator(old_imagepage)
         preloadingGen = pagegenerators.PreloadingGenerator(gen)
         bot = ImageRobot(preloadingGen, old_image, new_image, **options)
+       bot.site = pywikibot.Site()
         bot.run()
         return True
     else:

-- 
To view, visit https://gerrit.wikimedia.org/r/316060
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60f757a9281810453caea66f6a50a9200765a439
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: OdysseasKr <odysseask...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to