[CapGallery] correct method name

The modules using this capability and galleroob have been corrected too
This commit is contained in:
Alexandre Morignot 2014-12-05 05:53:22 +01:00 committed by Romain Bignon
commit 689fe43ed5
5 changed files with 6 additions and 6 deletions

View file

@ -51,7 +51,7 @@ class EHentaiBrowser(Browser):
def _gallery_page(self, gallery, n): def _gallery_page(self, gallery, n):
return gallery.url + ('?p='+str(n)) return gallery.url + ('?p='+str(n))
def search_gallery(self, pattern): def search_galleries(self, pattern):
self.location(self.buildurl('/', f_search=pattern.encode('utf-8'))) self.location(self.buildurl('/', f_search=pattern.encode('utf-8')))
assert self.is_on_page(IndexPage) assert self.is_on_page(IndexPage)
return self.page.iter_galleries() return self.page.iter_galleries()

View file

@ -53,9 +53,9 @@ class EHentaiModule(Module, CapGallery, CapCollection):
password = None password = None
return self.create_browser(self.config['domain'].get(), username, password) return self.create_browser(self.config['domain'].get(), username, password)
def search_gallery(self, pattern, sortby=None): def search_galleries(self, pattern, sortby=None):
with self.browser: with self.browser:
return self.browser.search_gallery(pattern) return self.browser.search_galleries(pattern)
def iter_gallery_images(self, gallery): def iter_gallery_images(self, gallery):
self.fillobj(gallery, ('url',)) self.fillobj(gallery, ('url',))

View file

@ -26,7 +26,7 @@ class EHentaiTest(BackendTest):
MODULE = 'ehentai' MODULE = 'ehentai'
def test_search(self): def test_search(self):
l = list(self.backend.search_gallery('lol')) l = list(self.backend.search_galleries('lol'))
self.assertTrue(len(l) > 0) self.assertTrue(len(l) > 0)
v = l[0] v = l[0]
self.backend.fillobj(v, ('url',)) self.backend.fillobj(v, ('url',))

View file

@ -71,7 +71,7 @@ class Galleroob(ReplApplication):
return 2 return 2
self.start_format(pattern=pattern) self.start_format(pattern=pattern)
for gallery in self.do('search_gallery', pattern=pattern): for gallery in self.do('search_galleries', pattern=pattern):
self.cached_format(gallery) self.cached_format(gallery)
def do_download(self, line): def do_download(self, line):

View file

@ -113,7 +113,7 @@ class CapGallery(Capability):
SEARCH_VIEWS, SEARCH_VIEWS,
SEARCH_DATE) = range(4) SEARCH_DATE) = range(4)
def search_gallery(self, pattern, sortby=SEARCH_RELEVANCE): def search_galleries(self, pattern, sortby=SEARCH_RELEVANCE):
""" """
Iter results of a search on a pattern. Iter results of a search on a pattern.