[feature-requests:#346] claimit.py: lang for source lookup

Status: open
Created: Sat Aug 31, 2013 12:40 PM UTC by APAC
Last Updated: Sat Aug 31, 2013 12:40 PM UTC
Owner: nobody

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".


Sent from sourceforge.net because Pywikipedia-bugs@lists.wikimedia.org is subscribed to https://sourceforge.net/p/pywikipediabot/feature-requests/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/pywikipediabot/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.