JJMC89 has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1323972?usp=email )
Change subject: wikiwho: Simplify helper returns
......................................................................
wikiwho: Simplify helper returns
Return constructed API URLs and cache paths directly instead of using temporary
variables.
Change-Id: I749e70d274e951f0962d4ea5cfe03a479bb81d7c
---
M pywikibot/page/_toolforge.py
1 file changed, 3 insertions(+), 6 deletions(-)
Approvals:
JJMC89: Verified; Looks good to me, approved
Xqt: Looks good to me, approved
diff --git a/pywikibot/page/_toolforge.py b/pywikibot/page/_toolforge.py
index 24c2a96..bbbeddc 100644
--- a/pywikibot/page/_toolforge.py
+++ b/pywikibot/page/_toolforge.py
@@ -265,9 +265,8 @@
article_title = self.title(with_ns=False, with_section=False)
encoded_title = urllib.parse.quote(article_title, safe='')
base_url = 'https://wikiwho-api.wmcloud.org'
- url = (f'{base_url}/{self.site.code}/api/v1.0.0-beta/{endpoint}/'
- f'{encoded_title}/')
- return url
+ return (f'{base_url}/{self.site.code}/api/v1.0.0-beta/{endpoint}/'
+ f'{encoded_title}/')
def get_annotations(self, *, use_cache: bool = True) -> dict[str, Any]:
"""Get WikiWho annotations for article revisions.
@@ -377,6 +376,4 @@
subdirectory = (page_id // 1000) * 1000
# Construct path: cache_dir/lang/subdirectory/page_id.p
- pickle_path = cache_dir / lang / str(subdirectory) / f'{page_id}.p'
-
- return pickle_path
+ return cache_dir / lang / str(subdirectory) / f'{page_id}.p'
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1323972?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I749e70d274e951f0962d4ea5cfe03a479bb81d7c
Gerrit-Change-Number: 1323972
Gerrit-PatchSet: 2
Gerrit-Owner: Mahveotm <[email protected]>
Gerrit-Reviewer: JJMC89 <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]