https://bugzilla.wikimedia.org/show_bug.cgi?id=55000
Web browser: --- Bug ID: 55000 Summary: claimit.py: lang for source lookup Product: Pywikibot Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: legoktm.wikipedia@gmail.com Classification: Unclassified Mobile Platform: ---
Originally from: http://sourceforge.net/p/pywikipediabot/feature-requests/346/ Reported by: apac1 Created on: 2013-08-31 12:40:09.399000 Subject: claimit.py: lang for source lookup Assigned to: legoktm Original description: def setSource(self, lang):
page = pywikibot.Page(self.repo, 'Wikidata:List of wikis/python') source_values = json.loads(page.get()) source_values = source_values['wikipedia'] for lang in source_values: source_values[lang] = pywikibot.ItemPage(self.repo, source_values[lang])
if lang in source_values: self.source = pywikibot.Claim(self.repo, 'p143') self.source.setTarget(source_values.get(lang))
The use of lang in "for lang in source_values:" overwrites the lang in "def setSource(self, lang)". This leads to incorrect results. "lang" should be the language of the source wiki. For -cat:"zh:Category:Somevalue" this would be "zh".
https://bugzilla.wikimedia.org/show_bug.cgi?id=55000
--- Comment #1 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- - **status**: open --> pending - **assigned_to**: Legoktm
https://bugzilla.wikimedia.org/show_bug.cgi?id=55000
--- Comment #2 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- https://gerrit.wikimedia.org/r/#/c/82106/
https://bugzilla.wikimedia.org/show_bug.cgi?id=55000
--- Comment #3 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- In the init part
self.setSource(pywikibot.Site().language())
might also need changing.
Currently, if in the config file there is
family = 'wikipedia' mylang = 'en'
and claimit is called with
-cat:zh:Category:Somevalue
this leads to "en" to be used, instead of "zh".
https://bugzilla.wikimedia.org/show_bug.cgi?id=55000
Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://sourceforge.net/p/p | |ywikipediabot/feature-reque | |sts/346
https://bugzilla.wikimedia.org/show_bug.cgi?id=55000
Nemo federicoleva@tiscali.it changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|General |Wikidata
https://bugzilla.wikimedia.org/show_bug.cgi?id=55000
xqt info@gno.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW CC| |info@gno.de
https://bugzilla.wikimedia.org/show_bug.cgi?id=55000
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jayvdb@gmail.com
--- Comment #4 from John Mark Vandenberg jayvdb@gmail.com --- (In reply to Kunal Mehta (Legoktm) from comment #3)
In the init part
self.setSource(pywikibot.Site().language())
might also need changing.
This was fixed by Legoktm in
https://gerrit.wikimedia.org/r/#/c/82263/
https://bugzilla.wikimedia.org/show_bug.cgi?id=55000
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED
pywikipedia-bugs@lists.wikimedia.org