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: """
pywikibot-commits@lists.wikimedia.org