style: format code with black and isort (#255)

Format code with black and isort

This commit fixes the style issues introduced in d5870ff according to the output
from Black and isort.

Details: https://app.deepsource.com/gh/yasirarism/MissKatyPyro/transform/bac346e3-3166-471a-9ee0-2e1cc9bd4fb7/

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
deepsource-autofix[bot] 2023-08-03 11:48:26 +07:00 committed by GitHub
parent d5870ffd6e
commit ae4a109777
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 7 deletions

View file

@ -7,6 +7,7 @@ from typing import Union
from pyrogram.errors import ( from pyrogram.errors import (
ChatAdminRequired, ChatAdminRequired,
ChatSendPlainForbidden,
ChatWriteForbidden, ChatWriteForbidden,
FloodWait, FloodWait,
MessageAuthorRequired, MessageAuthorRequired,
@ -15,7 +16,6 @@ from pyrogram.errors import (
MessageNotModified, MessageNotModified,
MessageTooLong, MessageTooLong,
TopicClosed, TopicClosed,
ChatSendPlainForbidden
) )
from pyrogram.types import Message from pyrogram.types import Message

View file

@ -7,9 +7,9 @@ from .kuso_utils import *
from .media_helper import * from .media_helper import *
from .misc import * from .misc import *
from .pyro_progress import * from .pyro_progress import *
from .sqlite_helper import Cache
from .stickerset import * from .stickerset import *
from .subscene_helper import * from .subscene_helper import *
from .time_gap import * from .time_gap import *
from .tools import * from .tools import *
from .ytdl_helper import * from .ytdl_helper import *
from .sqlite_helper import Cache

View file

@ -16,11 +16,11 @@ from typing import Any, Optional, Tuple
import aiohttp import aiohttp
import cloudscraper import cloudscraper
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from PIL import Image, ImageDraw, ImageFont from PIL import Image, ImageDraw, ImageFont
from psutil import Process, boot_time, cpu_count, cpu_percent from psutil import Process, boot_time, cpu_count, cpu_percent
from psutil import disk_usage as disk_usage_percent from psutil import disk_usage as disk_usage_percent
from psutil import net_io_counters, virtual_memory from psutil import net_io_counters, virtual_memory
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from pyrogram import Client from pyrogram import Client
from pyrogram import __version__ as pyrover from pyrogram import __version__ as pyrover
from pyrogram import enums, filters from pyrogram import enums, filters
@ -42,7 +42,7 @@ from misskaty.helper.functions import extract_user, extract_user_and_reason
from misskaty.helper.http import http from misskaty.helper.http import http
from misskaty.helper.human_read import get_readable_file_size, get_readable_time from misskaty.helper.human_read import get_readable_file_size, get_readable_time
from misskaty.helper.localization import use_chat_lang from misskaty.helper.localization import use_chat_lang
from misskaty.vars import COMMAND_HANDLER, LOG_CHANNEL, SUDO, AUTO_RESTART from misskaty.vars import AUTO_RESTART, COMMAND_HANDLER, LOG_CHANNEL, SUDO
__MODULE__ = "DevCommand" __MODULE__ = "DevCommand"
__HELP__ = """ __HELP__ = """
@ -543,10 +543,12 @@ async def shell_exec(code, treat=True):
stdout = stdout.decode().strip() stdout = stdout.decode().strip()
return stdout, process return stdout, process
async def auto_restart(): async def auto_restart():
await shell_exec("python3 update.py") await shell_exec("python3 update.py")
os.execvp(sys.executable, [sys.executable, "-m", "misskaty"]) os.execvp(sys.executable, [sys.executable, "-m", "misskaty"])
if AUTO_RESTART: if AUTO_RESTART:
scheduler = AsyncIOScheduler(timezone="Asia/Jakarta") scheduler = AsyncIOScheduler(timezone="Asia/Jakarta")
scheduler.add_job(auto_restart, trigger="interval", days=3) scheduler.add_job(auto_restart, trigger="interval", days=3)

View file

@ -118,7 +118,10 @@ async def carbon_make(self: Client, ctx: Message):
"https://carbon.yasirapi.eu.org/api/cook", json=json_data "https://carbon.yasirapi.eu.org/api/cook", json=json_data
) )
if response.status_code != 200: if response.status_code != 200:
return await ctx.reply_photo(f"https://http.cat/{response.status_code}", caption="<b>🤧 Carbon API ERROR</b>") return await ctx.reply_photo(
f"https://http.cat/{response.status_code}",
caption="<b>🤧 Carbon API ERROR</b>",
)
fname = ( fname = (
f"carbonBY_{ctx.from_user.id if ctx.from_user else ctx.sender_chat.title}.png" f"carbonBY_{ctx.from_user.id if ctx.from_user else ctx.sender_chat.title}.png"
) )

View file

@ -11,7 +11,7 @@ from pyrogram.types import CallbackQuery, Message
from misskaty import app from misskaty import app
from misskaty.core.decorator.ratelimiter import ratelimiter from misskaty.core.decorator.ratelimiter import ratelimiter
from misskaty.helper import http, Cache from misskaty.helper import Cache, http
from misskaty.plugins.web_scraper import headers, split_arr from misskaty.plugins.web_scraper import headers, split_arr
from misskaty.vars import COMMAND_HANDLER from misskaty.vars import COMMAND_HANDLER