http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11088
Revision: 11088 Author: drtrigon Date: 2013-02-19 20:11:53 +0000 (Tue, 19 Feb 2013) Log Message: ----------- bug fix; TypeError: sequence item 11: expected string or Unicode, tuple found
Modified Paths: -------------- trunk/pywikipedia/articlenos.py
Modified: trunk/pywikipedia/articlenos.py =================================================================== --- trunk/pywikipedia/articlenos.py 2013-02-19 19:23:37 UTC (rev 11087) +++ trunk/pywikipedia/articlenos.py 2013-02-19 20:11:53 UTC (rev 11088) @@ -25,8 +25,14 @@ SingleServerIRCBot.__init__(self, [(server, port)], nickname, nickname) self.channel = channel self.site = site + ns = [] + for n in site.namespaces(): + if type(n) == type(()): + ns += n[0] + else: + ns += [n] self.other_ns = re.compile( - u'14[[07(' + u'|'.join(site.namespaces()) + u')') + u'14[[07(' + u'|'.join(ns) + u')') self.api_url = self.site.api_address() self.api_url += 'action=query&meta=siteinfo&siprop=statistics&format=xml' self.api_found = re.compile(r'articles="(.*?)"')
pywikipedia-svn@lists.wikimedia.org