http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10153
Revision: 10153 Author: xqt Date: 2012-04-25 18:39:37 +0000 (Wed, 25 Apr 2012) Log Message: ----------- isPublic() method may depend from language code; update from rewrite
Modified Paths: -------------- trunk/pywikipedia/family.py trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/family.py =================================================================== --- trunk/pywikipedia/family.py 2012-04-25 18:16:32 UTC (rev 10152) +++ trunk/pywikipedia/family.py 2012-04-25 18:39:37 UTC (rev 10153) @@ -4207,7 +4207,7 @@ # TODO : If the local computer time is wrong, result will be wrong return datetime.utcnow() + self.servergmtoffset
- def isPublic(self): + def isPublic(self, code): """Does the wiki require logging in before viewing it?""" return True
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2012-04-25 18:16:32 UTC (rev 10152) +++ trunk/pywikipedia/wikipedia.py 2012-04-25 18:39:37 UTC (rev 10153) @@ -7668,7 +7668,7 @@ if key not in _sites: _sites[key] = Site(code=code, fam=fam, user=user) ret = _sites[key] - if not ret.family.isPublic() and not noLogin: + if not ret.family.isPublic(code) and not noLogin: ret.forceLogin() return ret