http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11128
Revision: 11128 Author: xqt Date: 2013-02-25 13:02:36 +0000 (Mon, 25 Feb 2013) Log Message: ----------- if no lang code is given and the default code is not in langs, use the last item (which gives 'wikidata' for the wikidata family). This enables this quicktest command line: testfamily -wikimedia
Modified Paths: -------------- trunk/pywikipedia/maintenance/testfamily.py
Modified: trunk/pywikipedia/maintenance/testfamily.py =================================================================== --- trunk/pywikipedia/maintenance/testfamily.py 2013-02-25 12:48:27 UTC (rev 11127) +++ trunk/pywikipedia/maintenance/testfamily.py 2013-02-25 13:02:36 UTC (rev 11128) @@ -63,8 +63,6 @@ wikimedia = True
mySite = pywikibot.getSite() - if language is None: - language = mySite.lang if wikimedia: families = ['commons', 'incubator', 'mediawiki', 'meta', 'species', 'test', 'wikibooks', 'wikidata', 'wikinews', 'wikiquote', @@ -83,6 +81,11 @@ if all: for lang in fam.langs.iterkeys(): testSite(pywikibot.getSite(lang, family)) + elif language is None: + lang = mySite.lang + if not lang in fam.langs.keys(): + lang = fam.langs.keys()[-1] + testSite(pywikibot.getSite(lang, family)) else: languages = language.split(',') for lang in languages:
pywikipedia-svn@lists.wikimedia.org