clean code

This commit is contained in:
Romain Bignon 2011-06-21 13:17:59 +02:00
commit 49b46ff095
4 changed files with 15 additions and 45 deletions

View file

@ -28,18 +28,14 @@ __all__ = ['GazelleBrowser']
class GazelleBrowser(BaseBrowser):
PAGES = {'https?://%s/?(index.php)?': IndexPage,
'https?://%s/login.php': LoginPage,
'https?://%s/torrents.php.*': TorrentsPage,
PAGES = {'https?://[^/]+/?(index.php)?': IndexPage,
'https?://[^/]+/login.php': LoginPage,
'https?://[^/]+/torrents.php.*': TorrentsPage,
}
def __init__(self, protocol, domain, *args, **kwargs):
self.DOMAIN = domain
self.PROTOCOL = protocol
self.PAGES = {}
for key, value in GazelleBrowser.PAGES.iteritems():
self.PAGES[key % domain] = value
BaseBrowser.__init__(self, *args, **kwargs)
def login(self):