`Black` refactored

pull/1/head
hikariatama 2022-08-03 18:50:28 +00:00
parent 7627caeb86
commit a4b6125618
4 changed files with 8 additions and 10 deletions

View File

@ -108,9 +108,7 @@ class CoreUnloadError(Exception):
super().__init__()
def __str__(self) -> str:
return (
f"Module {self.module} will not be unloaded, because it's core"
)
return f"Module {self.module} will not be unloaded, because it's core"
class SelfUnload(Exception):

View File

@ -1056,9 +1056,9 @@ class Modules:
ver = tuple(
map(
int,
re.search(r"# ?scope: ?hikka_min ((\d+\.){2}\d+)", code)[
1
].split("."),
re.search(r"# ?scope: ?hikka_min ((\d+\.){2}\d+)", code)[1].split(
"."
),
)
)
@ -1146,8 +1146,7 @@ class Modules:
if (
all(
line.replace(" ", "") != "#scope:no_stats"
for line in code.splitlines()
line.replace(" ", "") != "#scope:no_stats" for line in code.splitlines()
)
and self._db.get("hikka.main", "stats", True)
and url is not None

View File

@ -535,7 +535,9 @@ class Hikka:
)
self.sessions.remove(session)
except InteractiveAuthRequired:
logging.error(f"Session {session} was terminated and re-auth is required")
logging.error(
f"Session {session} was terminated and re-auth is required"
)
self.sessions.remove(session)
return bool(self.sessions)

View File

@ -192,7 +192,6 @@ class HelpMod(loader.Module):
else utils.escape_html(name)
)
reply = self.strings("single_mod_header").format(_name)
if module.__doc__:
reply += "<i>\n " + utils.escape_html(inspect.getdoc(module)) + "\n</i>"