Revision: 7709 Author: alexsh Date: 2009-11-28 20:34:05 +0000 (Sat, 28 Nov 2009)
Log Message: ----------- moved siteinfo to Site().siteinfo()
Modified Paths: -------------- trunk/pywikipedia/maintenance/family_check.py
Modified: trunk/pywikipedia/maintenance/family_check.py =================================================================== --- trunk/pywikipedia/maintenance/family_check.py 2009-11-28 20:33:27 UTC (rev 7708) +++ trunk/pywikipedia/maintenance/family_check.py 2009-11-28 20:34:05 UTC (rev 7709) @@ -13,17 +13,8 @@ # we can get the namespace names without API. wikipedia.output(u'Warning! %s is not support API!' % site) return - predata = { 'action': 'query', - 'meta': 'siteinfo', - 'siprop': 'namespaces'} - try: - data = query.GetData(predata, site)['query']['namespaces'] - except wikipedia.ServerError, e: - wikipedia.output(u'Warning! %s: %s' % (site, e)) - return - result = [] - for namespace in data.itervalues(): + for namespace in site.siteinfo('namespaces').itervalues(): try: defined_namespace = site.namespace(namespace['id']) except KeyError:
pywikipedia-svn@lists.wikimedia.org