cleanup/minor
This commit is contained in:
parent
685ac5f2f6
commit
97808e388f
2
api.py
2
api.py
@ -43,7 +43,7 @@ class API:
|
||||
|
||||
|
||||
def __init__():
|
||||
import util # pylint: disable=redefined-outer-name, reimported, import-outside-toplevel
|
||||
import util
|
||||
importlib.reload(util)
|
||||
|
||||
__init__()
|
@ -224,7 +224,7 @@ class Meme(commands.Cog):
|
||||
for meme in memes:
|
||||
if not meme:
|
||||
continue
|
||||
(meme_id, meme_title, meme_url) = meme # pylint: disable=unused-variable
|
||||
(meme_id, meme_title, meme_url) = meme
|
||||
request = requests.get(meme_url, stream=True, timeout=(5, 30), headers=headers)
|
||||
if not request.status_code == 200:
|
||||
continue
|
||||
|
@ -3,13 +3,13 @@ import traceback
|
||||
import urllib
|
||||
import datetime
|
||||
import random
|
||||
from typing import Optional, LiteralString
|
||||
from typing import Optional
|
||||
import logging
|
||||
import discord
|
||||
from cogs.misc_util import Util
|
||||
import aiosqlite as sqlite3
|
||||
from sh import cowsay as cow_say, fortune # pylint: disable=no-name-in-module
|
||||
from discord.ext import bridge, commands, tasks
|
||||
from sh import cowsay as cow_say, fortune
|
||||
from discord.ext import bridge, commands
|
||||
from disc_havoc import Havoc
|
||||
from constructors import MiscException
|
||||
|
||||
|
@ -4,7 +4,7 @@ import traceback
|
||||
import random
|
||||
import datetime
|
||||
import pytz
|
||||
from typing import Any, Optional, LiteralString, Union
|
||||
from typing import Optional, LiteralString, Union
|
||||
import regex
|
||||
import aiosqlite as sqlite3
|
||||
from aiohttp import ClientSession, ClientTimeout
|
||||
@ -418,7 +418,7 @@ class Util:
|
||||
day=25,
|
||||
tzinfo=pytz.UTC,
|
||||
)
|
||||
td: datetime.timedelta = (xmas - today) # pylint: disable=superfluous-parens
|
||||
td: datetime.timedelta = (xmas - today)
|
||||
days, hours, minutes, seconds, us, ms = self.tdTuple(td)
|
||||
|
||||
return (days, hours, minutes, seconds, ms, us)
|
||||
|
@ -115,8 +115,6 @@ class Radio(commands.Cog):
|
||||
# await vc.channel.set_status(f"Now playing: {np_track}")
|
||||
except:
|
||||
traceback.print_exc()
|
||||
|
||||
# pylint: enable=superfluous-parens
|
||||
|
||||
def cog_unload(self) -> None:
|
||||
"""Run on Cog Unload"""
|
||||
|
@ -62,7 +62,7 @@ class Havoc(bridge.Bot):
|
||||
load_method(f'cogs.{cog}')
|
||||
|
||||
importlib.reload(api)
|
||||
from api import API # pylint: disable=unused-import
|
||||
from api import API
|
||||
api_config = hypercorn.config.Config()
|
||||
api_config.bind = ["10.10.10.100:5992"]
|
||||
api_instance = api.API(self)
|
||||
|
@ -11,7 +11,7 @@ class DB:
|
||||
"sqlite_dbs", "lovehate.db")
|
||||
|
||||
async def get_wholovehates(self, thing: str, loves: bool = False,
|
||||
hates: bool = False) -> list[tuple]|bool:
|
||||
hates: bool = False) -> Union[list[tuple], bool]:
|
||||
"""
|
||||
Get a list of users who have professed their love OR hatred for <thing>
|
||||
|
||||
@ -20,7 +20,7 @@ class DB:
|
||||
loves (bool): Are we looking for loves?
|
||||
hates (bool): ...or are we looking for hates?
|
||||
Returns:
|
||||
list[tuple]
|
||||
Union[list[tuple], bool]
|
||||
"""
|
||||
|
||||
query: str = "SELECT display_name FROM lovehate WHERE thing LIKE ? AND flag = ?"
|
||||
|
Loading…
x
Reference in New Issue
Block a user