Revision: 7035 Author: alexsh Date: 2009-07-09 10:14:28 +0000 (Thu, 09 Jul 2009)
Log Message: ----------- Set the same lang and same project name when proect has one site only, it's no set -lang parameter when running script.just set -family could run.(tested on mediawiki and meta family files)
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2009-07-09 10:11:29 UTC (rev 7034) +++ trunk/pywikipedia/wikipedia.py 2009-07-09 10:14:28 UTC (rev 7035) @@ -4388,6 +4388,8 @@ if self.lang == 'zh-classic' and 'zh-classical' in self.languages(): self.lang = 'zh-classical' # ev0l database hack (database is varchar[10] -> zh-classical is cut to zh-classic. + elif self.family.name in self.family.langs.keys() or len(self.family.langs) == 1: + self.lang = self.family.name else: raise NoSuchSite("Language %s does not exist in family %s"%(self.lang,self.family.name))
pywikipedia-svn@lists.wikimedia.org