From b9c99f38eb4a5e4f6fad7b66ea9c95d6443da402 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 5 Aug 2020 01:55:10 +0200 Subject: [PATCH] Improve a few imports --- royalnet/backpack/commands/royalnetaliases.py | 2 -- royalnet/backpack/commands/royalnetroles.py | 2 -- royalnet/backpack/commands/royalnetsync.py | 12 ++++++------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/royalnet/backpack/commands/royalnetaliases.py b/royalnet/backpack/commands/royalnetaliases.py index 3fa88d48..c7e1ba4a 100644 --- a/royalnet/backpack/commands/royalnetaliases.py +++ b/royalnet/backpack/commands/royalnetaliases.py @@ -1,7 +1,5 @@ from typing import * -import royalnet import royalnet.commands as rc -import royalnet.utils as ru from ..tables import User diff --git a/royalnet/backpack/commands/royalnetroles.py b/royalnet/backpack/commands/royalnetroles.py index 93ff1d96..362c9eaf 100644 --- a/royalnet/backpack/commands/royalnetroles.py +++ b/royalnet/backpack/commands/royalnetroles.py @@ -1,7 +1,5 @@ from typing import * -import royalnet import royalnet.commands as rc -import royalnet.utils as ru from ..tables import User diff --git a/royalnet/backpack/commands/royalnetsync.py b/royalnet/backpack/commands/royalnetsync.py index 99c77bbf..6ef62a81 100644 --- a/royalnet/backpack/commands/royalnetsync.py +++ b/royalnet/backpack/commands/royalnetsync.py @@ -2,9 +2,9 @@ from typing import * import royalnet import royalnet.commands as rc import royalnet.utils as ru -import royalnet.serf.telegram -import royalnet.serf.discord -import royalnet.serf.matrix +import royalnet.serf.telegram as rst +import royalnet.serf.discord as rsd +import royalnet.serf.matrix as rsm from ..tables.telegram import Telegram from ..tables.discord import Discord @@ -30,7 +30,7 @@ class RoyalnetsyncCommand(rc.Command): if not successful: raise rc.InvalidInputError(f"Invalid password!") - if isinstance(self.serf, royalnet.serf.telegram.TelegramSerf): + if isinstance(self.serf, rst.TelegramSerf): import telegram message: telegram.Message = data.message from_user: telegram.User = message.from_user @@ -56,7 +56,7 @@ class RoyalnetsyncCommand(rc.Command): await data.session_commit() await data.reply(f"↔️ Account {tg_user} synced to {author}!") - elif isinstance(self.serf, royalnet.serf.discord.DiscordSerf): + elif isinstance(self.serf, rsd.DiscordSerf): import discord message: discord.Message = data.message author: discord.User = message.author @@ -82,7 +82,7 @@ class RoyalnetsyncCommand(rc.Command): await data.session_commit() await data.reply(f"↔️ Account {ds_user} synced to {author}!") - elif isinstance(self.serf, royalnet.serf.matrix.MatrixSerf): + elif isinstance(self.serf, rsm.MatrixSerf): raise rc.UnsupportedError(f"{self} hasn't been implemented for Matrix yet") else: