[CapGallery] correct method name
The modules using this capability and galleroob have been corrected too
This commit is contained in:
parent
527a6d6b5c
commit
689fe43ed5
5 changed files with 6 additions and 6 deletions
|
|
@ -51,7 +51,7 @@ class EHentaiBrowser(Browser):
|
|||
def _gallery_page(self, gallery, 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')))
|
||||
assert self.is_on_page(IndexPage)
|
||||
return self.page.iter_galleries()
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@ class EHentaiModule(Module, CapGallery, CapCollection):
|
|||
password = None
|
||||
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:
|
||||
return self.browser.search_gallery(pattern)
|
||||
return self.browser.search_galleries(pattern)
|
||||
|
||||
def iter_gallery_images(self, gallery):
|
||||
self.fillobj(gallery, ('url',))
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class EHentaiTest(BackendTest):
|
|||
MODULE = 'ehentai'
|
||||
|
||||
def test_search(self):
|
||||
l = list(self.backend.search_gallery('lol'))
|
||||
l = list(self.backend.search_galleries('lol'))
|
||||
self.assertTrue(len(l) > 0)
|
||||
v = l[0]
|
||||
self.backend.fillobj(v, ('url',))
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class Galleroob(ReplApplication):
|
|||
return 2
|
||||
|
||||
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)
|
||||
|
||||
def do_download(self, line):
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class CapGallery(Capability):
|
|||
SEARCH_VIEWS,
|
||||
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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue