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

Change subject: Resolve mixed up Link objects and Page objects in interwiki.py
......................................................................


Resolve mixed up Link objects and Page objects in interwiki.py

Page objects are not compatible with Link objects.
This patch adapts it by inserting conversions.

Change-Id: I22cba95d9c00cf3be433644cb1441e3cbc35b1f8
---
M pywikibot/titletranslate.py
M scripts/interwiki.py
2 files changed, 9 insertions(+), 7 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/titletranslate.py b/pywikibot/titletranslate.py
index 6eb4c99..84edbb8 100644
--- a/pywikibot/titletranslate.py
+++ b/pywikibot/titletranslate.py
@@ -17,7 +17,7 @@
 def translate(page, hints=None, auto=True, removebrackets=False, site=None,
               family=None):
     """
-    Goes through all entries in 'hints'. Returns a list of pages.
+    Goes through all entries in 'hints'. Returns a list of links to pages.
 
     Entries for single page titles list those pages. Page titles for entries
     such as "all:" or "xyz:" or "20:" are first built from the page title of
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 7881a72..637fe35 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -914,25 +914,26 @@
         """Add the given translation hints to the todo list"""
         if globalvar.same and self.originPage:
             if hints:
-                pages = titletranslate.translate(
+                links = titletranslate.translate(
                     self.originPage,
                     hints=hints + ['all:'],
                     auto=globalvar.auto,
                     removebrackets=globalvar.hintnobracket)
             else:
-                pages = titletranslate.translate(
+                links = titletranslate.translate(
                     self.originPage,
                     hints=['all:'],
                     auto=globalvar.auto,
                     removebrackets=globalvar.hintnobracket)
         else:
-            pages = titletranslate.translate(
+            links = titletranslate.translate(
                 self.originPage,
                 hints=hints,
                 auto=globalvar.auto,
                 removebrackets=globalvar.hintnobracket,
                 site=pywikibot.Site())
-        for page in pages:
+        for link in links:
+            page = pywikibot.Page(link)
             if globalvar.contentsondisk:
                 page = StoredPage(page)
             self.todo.add(page)
@@ -1233,12 +1234,13 @@
                     elif not newhint:
                         break
                     else:
-                        pages = titletranslate.translate(
+                        links = titletranslate.translate(
                             self.originPage,
                             hints=[newhint],
                             auto=globalvar.auto,
                             removebrackets=globalvar.hintnobracket)
-                        for page in pages:
+                        for link in links:
+                            page = pywikibot.Page(link)
                             self.addIfNew(page, counter, None)
                             if globalvar.hintsareright:
                                 self.hintedsites.add(page.site)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I22cba95d9c00cf3be433644cb1441e3cbc35b1f8
Gerrit-PatchSet: 5
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Whym <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to