Revision: 5876 Author: russblau Date: 2008-09-04 22:07:53 +0000 (Thu, 04 Sep 2008)
Log Message: ----------- more login problems
Modified Paths: -------------- branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py =================================================================== --- branches/rewrite/pywikibot/site.py 2008-09-04 21:54:53 UTC (rev 5875) +++ branches/rewrite/pywikibot/site.py 2008-09-04 22:07:53 UTC (rev 5876) @@ -395,6 +395,14 @@ """Log the user in if not already logged in.""" if not hasattr(self, "_siteinfo"): self._getsiteinfo() + # check whether a login cookie already exists for this user + if hasattr(self, "_userinfo"): + if sysop: + name = config.sysopnames[self.family.name][self.code] + else: + name = config.usernames[self.family.name][self.code] + if self._userinfo['name'] == name: + self._username = name if not self.logged_in(sysop): loginMan = api.LoginManager(site=self, sysop=sysop) if loginMan.login(retry = True):
pywikipedia-l@lists.wikimedia.org