Skip to content

Commit

Permalink
[IMPR] remove nnecessary parentheses after keyword (PYL-C0325)
Browse files Browse the repository at this point in the history
Change-Id: I9c54ff09f874a386767af2cfba676c608925b8f9
  • Loading branch information
xqt committed Jul 6, 2024
1 parent 8bc16b3 commit 649b24d
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pywikibot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
_ValueType = TypeVar('_ValueType')


OSWIN32 = (sys.platform == 'win32')
OSWIN32 = sys.platform == 'win32'


# This frozen set should contain all imported modules/variables, so it must
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/cosmetic_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def __init__(self, page: pywikibot.page.BasePage, *,
self.namespace = page.namespace()

self.show_diff = show_diff
self.template = (self.namespace == Namespace.TEMPLATE)
self.template = self.namespace == Namespace.TEMPLATE
self.talkpage = self.namespace >= 0 and self.namespace % 2 == 1
self.ignore = ignore

Expand Down
2 changes: 1 addition & 1 deletion pywikibot/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _parse_url(links: Mapping[str, Any]) -> dict[str, Any]:
if key != 'title':
key = key.replace('topiclist_', '').replace('-', '_')
if key == 'offset_dir':
new_params['reverse'] = (value == 'rev')
new_params['reverse'] = value == 'rev'
else:
new_params[key] = value
return new_params
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/site/_apisite.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def login(

if self.is_oauth_token_available():
if self.userinfo['name'] == self.username():
error_msg = (f'Logging in on {self} via OAuth failed')
error_msg = f'Logging in on {self} via OAuth failed'
elif self.username() is None:
error_msg = ('No username has been defined in your '
'user config file: you have to add in this '
Expand Down
2 changes: 1 addition & 1 deletion scripts/archivebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ def saveables(self) -> list[str]:
def attr2text(self) -> str:
"""Return a template with archiver saveable attributes."""
return '{{%s\n%s\n}}' \
% (self.tpl.title(with_ns=(self.tpl.namespace() != 10)),
% (self.tpl.title(with_ns=self.tpl.namespace() != 10),
'\n'.join(f'|{a} = {self.get_attr(a)}'
for a in self.saveables()))

Expand Down
2 changes: 1 addition & 1 deletion scripts/checkimages.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ def check_image_duplicated(self, duplicates_rollback) -> bool:
if dup_page.title(as_url=True) != self.image.title(
as_url=True) or self.timestamp is None:
try:
self.timestamp = (dup_page.latest_file_info.timestamp)
self.timestamp = dup_page.latest_file_info.timestamp
except PageRelatedError:
continue
data = self.timestamp.timetuple()
Expand Down
2 changes: 1 addition & 1 deletion scripts/interwiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,7 @@ def replaceLinks(self, page, newPages) -> bool:
pywikibot.info(f'<<lightpurple>>Updating links on page {page}.')
pywikibot.info(f'Changes to be made: {mods}')
oldtext = page.get()
template = (page.namespace() == 10)
template = page.namespace() == 10
newtext = textlib.replaceLanguageLinks(oldtext, new,
site=page.site,
template=template)
Expand Down
2 changes: 1 addition & 1 deletion scripts/transferbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def main(*args: str) -> None:
target_title = prefix + page.title()
page = pywikibot.Page(fromsite, title)
else:
target_title = (prefix + title)
target_title = prefix + title
targetpage = pywikibot.Page(tosite, target_title)
edithistpage = pywikibot.Page(tosite, target_title + '/edithistory')

Expand Down

0 comments on commit 649b24d

Please sign in to comment.