jenkins-bot has submitted this change and it was merged.

Change subject: Bug 68658-imagerecat fails to process pages
......................................................................


Bug 68658-imagerecat fails to process pages

Fix: replaced page.site() with page.site.

In addition to bug fixing, also changed:
- page.get() to page.text
- page.put() to page.save()

Change-Id: Ie2b579e640b8e116fd107d5727b07dac16e93280
---
M scripts/imagerecat.py
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  John Vandenberg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/imagerecat.py b/scripts/imagerecat.py
index 748985e..a2a76e6 100644
--- a/scripts/imagerecat.py
+++ b/scripts/imagerecat.py
@@ -76,7 +76,7 @@
     for page in generator:
         if page.exists() and (page.namespace() == 6) and \
            (not page.isRedirectPage()):
-            imagepage = pywikibot.ImagePage(page.site(), page.title())
+            imagepage = pywikibot.ImagePage(page.site, page.title())
             pywikibot.output(u'Working on ' + imagepage.title())
 
             if onlyUncat and not(u'Uncategorized' in imagepage.templates()):
@@ -390,7 +390,7 @@
 
 def saveImagePage(imagepage, newcats, usage, galleries, onlyFilter):
     """ Remove the old categories and add the new categories to the image. """
-    newtext = pywikibot.removeCategoryLinks(imagepage.get(), imagepage.site())
+    newtext = pywikibot.removeCategoryLinks(imagepage.text, imagepage.site)
     if not onlyFilter:
         newtext = removeTemplates(newtext)
         newtext = newtext + getCheckCategoriesTemplate(usage, galleries,
@@ -402,8 +402,9 @@
         comment = u'Filtering categories'
     else:
         comment = u'Image is categorized by a bot using data from 
[[Commons:Tools#CommonSense|CommonSense]]'
-    pywikibot.showDiff(imagepage.get(), newtext)
-    imagepage.put(newtext, comment)
+    pywikibot.showDiff(imagepage.text, newtext)
+    imagepage.text = newtext
+    imagepage.save(comment)
     return
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie2b579e640b8e116fd107d5727b07dac16e93280
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to