Revision: 4646 Author: rotem Date: 2007-12-09 11:35:19 +0000 (Sun, 09 Dec 2007)
Log Message: ----------- Adding a language parameter to testfamily.py, to check some comma-seperated languages.
Modified Paths: -------------- trunk/pywikipedia/testfamily.py
Modified: trunk/pywikipedia/testfamily.py =================================================================== --- trunk/pywikipedia/testfamily.py 2007-12-09 10:53:43 UTC (rev 4645) +++ trunk/pywikipedia/testfamily.py 2007-12-09 11:35:19 UTC (rev 4646) @@ -28,7 +28,6 @@
def testSite(site): try: - wikipedia.getall(site, [wikipedia.Page(site, 'Any page name')]) except KeyboardInterrupt: raise @@ -39,22 +38,28 @@
def main(): all = False + language = None for arg in wikipedia.handleArgs(): if arg == '-all': all = True - + elif arg[0:10] == '-language:': + language = arg[10:] + mySite = wikipedia.getSite() + if language is None: + language = mySite.lang fam = mySite.family
if all: for lang in fam.langs.iterkeys(): testSite(wikipedia.getSite(lang)) else: - testSite(mySite) - + languages = language.split(',') + for lang in languages: + testSite(wikipedia.getSite(lang)) + if False: # skip until the family gets global fixing - wikipedia.output(u"\n\n------------------ namespace table -------------------\n");
wikipedia.output(u" self.namespaces = {")
pywikipedia-l@lists.wikimedia.org