http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10723
Revision: 10723 Author: xqt Date: 2012-11-14 08:59:15 +0000 (Wed, 14 Nov 2012) Log Message: ----------- remove unused linksearch method
Modified Paths: -------------- branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py =================================================================== --- branches/rewrite/pywikibot/site.py 2012-11-14 08:51:47 UTC (rev 10722) +++ branches/rewrite/pywikibot/site.py 2012-11-14 08:59:15 UTC (rev 10723) @@ -636,7 +636,6 @@ ## (note, some methods yield other information in a tuple along with the ## Pages; see method docs for details) -- ## -## linksearch: Special:Linksearch
def __init__(self, code, fam=None, user=None, sysop=None): BaseSite.__init__(self, code, fam, user, sysop) @@ -3313,30 +3312,3 @@ f = open(fn) self._cookies[index] = '; '.join([x.strip() for x in f.readlines()]) f.close() - - # THESE ARE FUNCTIONS NOT YET IMPLEMENTED IN THE API - def linksearch(self, siteurl): - """Yield Pages from results of Special:Linksearch for 'siteurl'.""" - if siteurl.startswith('*.'): - siteurl = siteurl[2:] - output(u'Querying [[Special:Linksearch]]...') - cache = [] - for url in [siteurl, '*.' + siteurl]: - path = self.linksearch_address(url) - get_throttle() - html = self.getUrl(path) - loc = html.find('<div class="mw-spcontent">') - if loc > -1: - html = html[loc:] - loc = html.find('<div class="printfooter">') - if loc > -1: - html = html[:loc] - R = re.compile('title ?="(.*?)"') - for title in R.findall(html): - if not siteurl in title: - # the links themselves have similar form - if title in cache: - continue - else: - cache.append(title) - yield Page(self, title)
pywikipedia-svn@lists.wikimedia.org