Skip to content

Commit

Permalink
Auto-format code [skip actions]
Browse files Browse the repository at this point in the history
  • Loading branch information
5hojib committed Jan 2, 2025
1 parent 09fcd16 commit 80f5ac1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
21 changes: 7 additions & 14 deletions bot/helper/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,8 @@ async def decompress_zst(self, dl_path, is_dir=False):
stderr = (
(await self.subproc.stderr.read())
.decode()
.strip())
.strip()
)
except Exception:
stderr = "Unable to decode the error!"
LOGGER.error(
Expand All @@ -607,10 +608,7 @@ async def decompress_zst(self, dl_path, is_dir=False):
if code != 0:
try:
async with self.subprocess_lock:
stderr = (
(await self.subproc.stderr.read())
.decode()
.strip())
stderr = (await self.subproc.stderr.read()).decode().strip()
except Exception:
stderr = "Unable to decode the error!"
LOGGER.error(
Expand Down Expand Up @@ -684,7 +682,8 @@ async def proceed_extract(self, dl_path, gid):
stderr = (
(await self.subproc.stderr.read())
.decode()
.strip())
.strip()
)
except Exception:
stderr = "Unable to decode the error!"
LOGGER.error(
Expand Down Expand Up @@ -744,10 +743,7 @@ async def proceed_extract(self, dl_path, gid):
return up_path
try:
async with self.subprocess_lock:
stderr = (
(await self.subproc.stderr.read())
.decode()
.strip())
stderr = (await self.subproc.stderr.read()).decode().strip()
except Exception:
stderr = "Unable to decode the error!"
LOGGER.error(
Expand Down Expand Up @@ -836,10 +832,7 @@ async def proceed_compress(self, dl_path, gid, o_files, ft_delete):
self.new_dir = ""
try:
async with self.subprocess_lock:
stderr = (
(await self.subproc.stderr.read())
.decode()
.strip())
stderr = (await self.subproc.stderr.read()).decode().strip()
except Exception:
stderr = "Unable to decode the error!"
LOGGER.error(f"{stderr}. Unable to zip this path: {dl_path}")
Expand Down
6 changes: 3 additions & 3 deletions bot/helper/ext_utils/bot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ def arg_parser(items, arg_base):
if not sub_list:
break
check = " ".join(sub_list).strip()
if check.startswith("[") and check.endswith("]"):
break
elif not check.startswith("["):
if (
check.startswith("[") and check.endswith("]")
) or not check.startswith("["):
break
sub_list.append(items[j])
if sub_list:
Expand Down
4 changes: 3 additions & 1 deletion bot/helper/ext_utils/media_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,9 @@ async def split_file(
if code != 0:
try:
async with listener.subprocess_lock:
stderr = (await listener.subproc.stderr.read()).decode().strip()
stderr = (
(await listener.subproc.stderr.read()).decode().strip()
)
except Exception:
stderr = "Unable to decode the error!"
with contextlib.suppress(Exception):
Expand Down

0 comments on commit 80f5ac1

Please sign in to comment.