Revision: 7027 Author: alexsh Date: 2009-07-07 19:00:37 +0000 (Tue, 07 Jul 2009)
Log Message: ----------- Add exception for API disabled families, and comment some ideas for get namespaces without API.
Modified Paths: -------------- trunk/pywikipedia/maintenance/family_check.py
Modified: trunk/pywikipedia/maintenance/family_check.py =================================================================== --- trunk/pywikipedia/maintenance/family_check.py 2009-07-07 04:55:39 UTC (rev 7026) +++ trunk/pywikipedia/maintenance/family_check.py 2009-07-07 19:00:37 UTC (rev 7027) @@ -7,8 +7,14 @@ import simplejson
def check_namespaces(site): - if not site.apipath(): - output(u'Warning! %s has no apipath() defined!' % site) + try: + if not site.apipath(): + output(u'Warning! %s has no apipath() defined!' % site) + return + except NotImplementedError: +# TODO: If use Special:Export to get XML file and parse details in <namespaces></namespaces>, +# we can get the namespace names without API. + output(u'Warning! %s is not support API!' % site) return predata = { 'action': 'query', 'meta': 'siteinfo',
pywikipedia-svn@lists.wikimedia.org