Revision: 8619 Author: xqt Date: 2010-10-07 08:51:35 +0000 (Thu, 07 Oct 2010)
Log Message: ----------- GetDisambigTemplates(site) removed - it never worked
Modified Paths: -------------- trunk/pywikipedia/query.py
Modified: trunk/pywikipedia/query.py =================================================================== --- trunk/pywikipedia/query.py 2010-10-07 08:39:30 UTC (rev 8618) +++ trunk/pywikipedia/query.py 2010-10-07 08:51:35 UTC (rev 8619) @@ -195,42 +195,6 @@ params = CombineParams( params, extraParams ) return GetData(params, site)
-def GetDisambigTemplates(site): - """This method will return a set of disambiguation templates. - Template:Disambig is always assumed to be default, and will be - appended (in localized format) regardless of its existence. - The rest will be aquired from the Wikipedia:Disambiguation Templates page. - Only links to templates will be used from that page. - """ - - disambigs = set() - disambigName = wikipedia.translate(site, site.family.disambiguationTemplates()) - disListName = u"Wikipedia:Disambiguation Templates" - disListId = 0 - - templateNames = GetLinks(site, [disListName, disambigName]) - for id, page in templateNames['pages'].iteritems(): - if page['title'] in disambigName: - if 'normalizedTitle' in page: - disambigs.add(page['normalizedTitle']) - elif 'redirect' in page: - disambigs.add(page['title']) - elif page['title'] == disListName: - if 'normalizedTitle' in page: - if 'refid' in page: - disListId = page['refid'] - else: - disListId = id - - # Disambig page was found - if disListId > 0: - page = templateNames['pages'][disListId] - if 'links' in page: - for l in page['links']: - if l['ns'] == 10: - disambigs.add(l['*']) - - return disambigs # # # Helper utilities