jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1029623?usp=email )
Change subject: [IMPR] make Subject.get_alternative() a static method, class
isn't used
......................................................................
[IMPR] make Subject.get_alternative() a static method, class isn't used
Change-Id: I47450fc84884fed44c6d67c3d82395ae6fb52630
---
M scripts/interwiki.py
1 file changed, 2 insertions(+), 5 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 61a13fe..3e3e8f0 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -821,8 +821,8 @@
or self.namespaceMismatch(page, target, counter) \
or self.wiktionaryMismatch(target)
+ @staticmethod
def get_alternative(
- self,
site: pywikibot.site.BaseSite
) -> pywikibot.Page | None:
"""Ask for an alternative Page for a given site.
@@ -831,10 +831,7 @@
"""
title = pywikibot.input(f'Give the alternative page for code '
f'{site.code!r} (without site code)')
- if title:
- return pywikibot.Page(site, title)
-
- return None
+ return pywikibot.Page(site, title) if title else None
def namespaceMismatch(self, linkingPage, linkedPage, counter) -> bool:
"""
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1029623?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I47450fc84884fed44c6d67c3d82395ae6fb52630
Gerrit-Change-Number: 1029623
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]