Skip to content

Commit

Permalink
refactor: remove unnecessary parentheses after keyword (SilentDemonSD#3)
Browse files Browse the repository at this point in the history
Extra parentheses in code can be removed for improved readability.  In the examples below, the first example is more readable than the second one.

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
  • Loading branch information
deepsource-autofix[bot] authored Apr 24, 2023
1 parent 0fe9552 commit b4854cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tobrot/plugins/help_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ async def picture_add(client: Client, message: Message):
pic_add = msg_text.strip()
await editable.edit("Adding your Link ...")
elif resm.photo:
if not ((resm.photo and resm.photo.file_size <= TGH_LIMIT)):
if not resm.photo and resm.photo.file_size <= TGH_LIMIT:
await editable.edit("This Media is Not Supported! Only Send Photos !!")
return
await editable.edit("Uploading to te.legra.ph Server ...")
Expand Down
8 changes: 4 additions & 4 deletions tobrot/plugins/incoming_message_fn.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async def incoming_message_f(client: Client, message: Message, auto_cmd=None):
return

if BOT_PM and LEECH_LOG and not auto_cmd:
if not (await check_bot_pm(client, message)):
if not await check_bot_pm(client, message):
return
elif BOT_PM and not auto_cmd:
LOGGER.warning("[BOT PM] Must Provide LEECH_LOG to Use it")
Expand Down Expand Up @@ -321,12 +321,12 @@ async def g_clonee(client: Client, message: Message):
g_id, _ = getUserOrChaDetails(message)

if BOT_PM and LEECH_LOG:
if not (await check_bot_pm(client, message)):
if not await check_bot_pm(client, message):
return
elif BOT_PM and (not LEECH_LOG):
LOGGER.warning("[Bot PM] Must Provide LEECH_LOG to Use it")

if (not RCLONE_CONF_URL):
if not RCLONE_CONF_URL:
LOGGER.info("[RCLONE] RCLONE_CONF_URL not Provided !!")
return
_link = message.text.split(" ", maxsplit=1)
Expand Down Expand Up @@ -366,7 +366,7 @@ async def g_clonee(client: Client, message: Message):
async def rename_tg_file(client: Client, message: Message):
usr_id, tag_me = getUserOrChaDetails(message)
if BOT_PM and LEECH_LOG:
if not (await check_bot_pm(client, message)):
if not await check_bot_pm(client, message):
return
elif BOT_PM and (not LEECH_LOG):
LOGGER.warning("[Bot PM] Must Provide LEECH_LOG to Use it")
Expand Down
8 changes: 4 additions & 4 deletions tobrot/plugins/torrent_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def get_formatted_string(self, values):
magnet = values.get('magnet', values.get('Magnet')) # Avoid updating source dict
if magnet:
extra += f"⚡Magnet: `{self.format_magnet(magnet)}`"
if (extra):
if extra:
string += "\n" + extra
return string

Expand All @@ -202,10 +202,10 @@ async def update_message(self):
nextBtn = InlineKeyboardButton(f"Next", callback_data=f"{self.command}_next")

inline = []
if (self.index != 0):
if self.index != 0:
inline.append(prevBtn)
inline.append(delBtn)
if (self.index != len(self.response_range) - 1):
if self.index != len(self.response_range) - 1:
inline.append(nextBtn)

res_lim = min(self.RESULT_LIMIT, len(self.response) - self.RESULT_LIMIT*self.index)
Expand All @@ -231,7 +231,7 @@ async def find(self, client, message):
try:
async with aiohttp.ClientSession() as session:
async with session.get(f"{self.source}/{query}", timeout=15) as resp:
if (resp.status != 200):
if resp.status != 200:
raise Exception('unsuccessful request')
result = await resp.json()
if (result and isinstance(result[0], list)):
Expand Down

0 comments on commit b4854cf

Please sign in to comment.