http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10833
Revision: 10833 Author: yurik Date: 2012-12-26 03:35:36 +0000 (Wed, 26 Dec 2012) Log Message: ----------- user names must be normalized to avoid repeated API calls for userinfo.
Modified Paths: -------------- branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py =================================================================== --- branches/rewrite/pywikibot/site.py 2012-12-25 20:32:23 UTC (rev 10832) +++ branches/rewrite/pywikibot/site.py 2012-12-26 03:35:36 UTC (rev 10833) @@ -143,8 +143,11 @@ raise NoSuchSite("Language %s does not exist in family %s" % (self.__code, self.__family.name))
+ self.nocapitalize = self.code in self.family.nocapitalize + if not self.nocapitalize: + user = None if user is None else user[0].upper() + user[1:] + sysop = None if sysop is None else sysop[0].upper() + sysop[1:] self._username = [user, sysop] - self.nocapitalize = self.code in self.family.nocapitalize
# following are for use with lock_page and unlock_page methods self._pagemutex = threading.Lock()
pywikipedia-svn@lists.wikimedia.org