replace 'result' with 'results' for lists
more consistent names
This commit is contained in:
@@ -880,15 +880,15 @@ class Dispatch():
|
||||
elif isinstance(include, str):
|
||||
include = include.replace(" ", "").split(",")
|
||||
|
||||
result = [(Message.Version, 1)]
|
||||
results = [(Message.Version, 1)]
|
||||
for category in include:
|
||||
try:
|
||||
extr, url = extractors[category]
|
||||
except KeyError:
|
||||
self.log.warning("Invalid include '%s'", category)
|
||||
else:
|
||||
result.append((Message.Queue, url, {"_extractor": extr}))
|
||||
return iter(result)
|
||||
results.append((Message.Queue, url, {"_extractor": extr}))
|
||||
return iter(results)
|
||||
|
||||
|
||||
class AsynchronousMixin():
|
||||
|
||||
@@ -1882,9 +1882,7 @@ class DeviantartOAuthAPI():
|
||||
params["offset"] = int(params["offset"]) + len(results)
|
||||
|
||||
def _pagination_list(self, endpoint, params, key="results"):
|
||||
result = []
|
||||
result.extend(self._pagination(endpoint, params, False, key=key))
|
||||
return result
|
||||
return list(self._pagination(endpoint, params, False, key=key))
|
||||
|
||||
def _shared_content(self, results):
|
||||
"""Return an iterable of shared deviations in 'results'"""
|
||||
|
||||
@@ -80,7 +80,7 @@ class HitomiGalleryExtractor(HitomiExtractor, GalleryExtractor):
|
||||
fmt = ext = self.config("format") or "webp"
|
||||
check = (fmt != "webp")
|
||||
|
||||
result = []
|
||||
results = []
|
||||
for image in self.info["files"]:
|
||||
if check:
|
||||
ext = fmt if image.get("has" + fmt) else "webp"
|
||||
@@ -93,8 +93,8 @@ class HitomiGalleryExtractor(HitomiExtractor, GalleryExtractor):
|
||||
inum = int(ihash[-1] + ihash[-3:-1], 16)
|
||||
url = (f"https://{ext[0]}{gg_m.get(inum, gg_default) + 1}."
|
||||
f"{self.domain}/{gg_b}/{inum}/{ihash}.{ext}")
|
||||
result.append((url, idata))
|
||||
return result
|
||||
results.append((url, idata))
|
||||
return results
|
||||
|
||||
|
||||
class HitomiTagExtractor(HitomiExtractor):
|
||||
|
||||
@@ -63,14 +63,14 @@ class MangareadMangaExtractor(MangareadBase, MangaExtractor):
|
||||
if 'class="error404' in page:
|
||||
raise exception.NotFoundError("manga")
|
||||
data = self.metadata(page)
|
||||
result = []
|
||||
results = []
|
||||
for chapter in text.extract_iter(
|
||||
page, '<li class="wp-manga-chapter', "</li>"):
|
||||
url , pos = text.extract(chapter, '<a href="', '"')
|
||||
info, _ = text.extract(chapter, ">", "</a>", pos)
|
||||
self.parse_chapter_string(info, data)
|
||||
result.append((url, data.copy()))
|
||||
return result
|
||||
results.append((url, data.copy()))
|
||||
return results
|
||||
|
||||
def metadata(self, page):
|
||||
extr = text.extract_from(text.extr(
|
||||
|
||||
@@ -44,7 +44,7 @@ class TelegraphGalleryExtractor(GalleryExtractor):
|
||||
num_zeroes = len(str(len(figures)))
|
||||
num = 0
|
||||
|
||||
result = []
|
||||
results = []
|
||||
for figure in figures:
|
||||
url, pos = text.extract(figure, 'src="', '"')
|
||||
if url.startswith("/embed/"):
|
||||
@@ -54,10 +54,10 @@ class TelegraphGalleryExtractor(GalleryExtractor):
|
||||
caption, pos = text.extract(figure, "<figcaption>", "<", pos)
|
||||
num += 1
|
||||
|
||||
result.append((url, {
|
||||
results.append((url, {
|
||||
"url" : url,
|
||||
"caption" : text.unescape(caption) if caption else "",
|
||||
"num" : num,
|
||||
"num_formatted": str(num).zfill(num_zeroes),
|
||||
}))
|
||||
return result
|
||||
return results
|
||||
|
||||
Reference in New Issue
Block a user