jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/894653 )
Change subject: [IMPR] use f-string instead of format method ......................................................................
[IMPR] use f-string instead of format method
Change-Id: I24e99317d9eabc2cf5cd34eda9f43980e25e2028 --- M pywikibot/site/_basesite.py 1 file changed, 15 insertions(+), 9 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site/_basesite.py b/pywikibot/site/_basesite.py index 92b79d7..a13cec7 100644 --- a/pywikibot/site/_basesite.py +++ b/pywikibot/site/_basesite.py @@ -316,27 +316,24 @@ try: name = dp.getSitelink(self) except NoPageError: - raise Error( - 'No disambiguation category name found in {repo} ' - 'for {site}'.format(repo=repo_name, site=self)) + raise Error(f'No disambiguation category name found in {repo} ' + f'for {self}')
else: # fallback for non WM sites try: name = '{}:{}'.format(Namespace.CATEGORY, self.family.disambcatname[self.code]) except KeyError: - raise Error( - 'No disambiguation category name found in ' - '{site.family.name}_family for {site}'.format(site=self)) + raise Error(f'No disambiguation category name found in ' + f'{self.family.name}_family for {self}')
return pywikibot.Category(pywikibot.Link(name, self))
def isInterwikiLink(self, text): # noqa: N802 """Return True if text is in the form of an interwiki link.
- If a link object constructed using "text" as the link text parses as - belonging to a different site, this method returns True. - + If a link object constructed using "text" as the link text parses + as belonging to a different site, this method returns True. """ linkfam, linkcode = pywikibot.Link(text, self).parse_site() return linkfam != self.family.name or linkcode != self.code