http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11358
Revision: 11358 Author: legoktm Date: 2013-04-08 12:56:05 +0000 (Mon, 08 Apr 2013) Log Message: ----------- Rename getdbName since it was conflictng
Modified Paths: -------------- branches/rewrite/pywikibot/page.py
Modified: branches/rewrite/pywikibot/page.py =================================================================== --- branches/rewrite/pywikibot/page.py 2013-04-08 08:11:24 UTC (rev 11357) +++ branches/rewrite/pywikibot/page.py 2013-04-08 12:56:05 UTC (rev 11358) @@ -2312,7 +2312,7 @@ del data[key] return data
- def __getdbName(self, site): + def getdbName(self, site): """ Helper function to normalize site objects into dbnames @@ -2446,7 +2446,7 @@ """ if force or not hasattr(self, '_content'): self.get(force=force) - dbname = self.__getdbName(site) + dbname = self.getdbName(site) if not dbname in self.sitelinks: raise pywikibot.NoPage(self) else: @@ -2471,10 +2471,10 @@ Sites should be a list, with values either being Site objects, or dbNames. """ - data = {} + data = list() for site in sites: - site = self.__getdbName(site) - data[site] = {'site': site, 'title': ''} + site = self.getdbName(site) + data.append({'site': site, 'title': ''}) self.setSitelinks(data, **kwargs)
def setSitelinks(self, sitelinks, **kwargs): @@ -2487,7 +2487,7 @@ data = {} for obj in sitelinks: if isinstance(obj, Page): - dbName = self.__getdbName(obj.site) + dbName = self.getdbName(obj.site) data[dbName] = {'site': dbName, 'title': obj.title()} else: #TODO: Do some verification here