new method BaseBrowser.buildurl()

This commit is contained in:
Romain Bignon 2010-05-12 11:05:45 +02:00
commit 0dbf00f7ac
3 changed files with 24 additions and 5 deletions

View file

@ -22,7 +22,6 @@ from weboob.tools.browser import BaseBrowser
from .pages.index import IndexPage, LoginPage
from .pages.torrents import TorrentsPage
import urllib
__all__ = ['GazelleBrowser']
@ -61,7 +60,7 @@ class GazelleBrowser(BaseBrowser):
return self.location('%s://%s/login.php' % (self.PROTOCOL, self.DOMAIN))
def iter_torrents(self, pattern):
self.location('/torrents.php?searchstr=%s' % urllib.quote_plus(pattern))
self.location(self.buildurl('/torrents.php', searchstr=pattern))
assert self.is_on_page(TorrentsPage)
return self.page.iter_torrents()