Update all imports with new file structure.
This commit is contained in:
+3
-2
@@ -5,8 +5,9 @@ import sys
|
|||||||
|
|
||||||
import nextcord
|
import nextcord
|
||||||
from nextcord.ext import commands
|
from nextcord.ext import commands
|
||||||
from utilities import config
|
|
||||||
from utilities.logger import agon_logger
|
from . import config
|
||||||
|
from .logger import agon_logger
|
||||||
|
|
||||||
|
|
||||||
def run() -> None:
|
def run() -> None:
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
from nextcord.ext import commands
|
from nextcord.ext import commands
|
||||||
|
|
||||||
from cogs.commands.create import CreateCog
|
from agon.cogs.commands.create import CreateCog
|
||||||
from cogs.commands.delete import DeleteCog
|
from agon.cogs.commands.delete import DeleteCog
|
||||||
from cogs.commands.get import GetCog
|
from agon.cogs.commands.get import GetCog
|
||||||
from cogs.commands.help import HelpCog
|
from agon.cogs.commands.help import HelpCog
|
||||||
from cogs.commands.refresh import RefreshCog
|
from agon.cogs.commands.refresh import RefreshCog
|
||||||
from cogs.commands.set import SetCog
|
from agon.cogs.commands.set import SetCog
|
||||||
from cogs.commands.submission import SubmissionCog
|
from agon.cogs.commands.submission import SubmissionCog
|
||||||
from cogs.commands.update import UpdateCog
|
from agon.cogs.commands.update import UpdateCog
|
||||||
from cogs.commands.view import ViewCog
|
from agon.cogs.commands.view import ViewCog
|
||||||
|
|
||||||
|
|
||||||
# This function will be called when this extension is loaded.
|
# This function will be called when this extension is loaded.
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ from sqlalchemy import exc, select
|
|||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from sqlmodel import col
|
from sqlmodel import col
|
||||||
|
|
||||||
from database.db import engine
|
from agon.database.db import engine
|
||||||
from database.models import Category, CategoryGroup
|
from agon.database.models import Category, CategoryGroup
|
||||||
from utilities.utils import MAX_LINE_LENGTH, autofill_groups, send_highscore_message
|
from agon.utils import MAX_LINE_LENGTH, autofill_groups, send_highscore_message
|
||||||
|
|
||||||
|
|
||||||
class CreateCog(commands.Cog, name="Create Cog"):
|
class CreateCog(commands.Cog, name="Create Cog"):
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ from sqlalchemy import distinct, select
|
|||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from sqlmodel import col
|
from sqlmodel import col
|
||||||
|
|
||||||
from database.db import engine
|
from agon.database.db import engine
|
||||||
from database.models import Category, CategoryGroup, Score
|
from agon.database.models import Category, CategoryGroup, Score
|
||||||
from utilities.utils import (
|
from agon.utils import (
|
||||||
autofill_categories,
|
autofill_categories,
|
||||||
autofill_groups,
|
autofill_groups,
|
||||||
autofill_users_in_group_category,
|
autofill_users_in_group_category,
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import nextcord
|
|||||||
from nextcord.ext import commands
|
from nextcord.ext import commands
|
||||||
from sqlmodel import Session, col, select
|
from sqlmodel import Session, col, select
|
||||||
|
|
||||||
from database.db import engine
|
from agon.database.db import engine
|
||||||
from database.models import Category, CategoryGroup
|
from agon.database.models import Category, CategoryGroup
|
||||||
from utilities.utils import autofill_categories, autofill_groups
|
from agon.utils import autofill_categories, autofill_groups
|
||||||
|
|
||||||
|
|
||||||
class GetCog(commands.Cog, name="Get command."):
|
class GetCog(commands.Cog, name="Get command."):
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ from sqlalchemy import select
|
|||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from sqlmodel import col
|
from sqlmodel import col
|
||||||
|
|
||||||
from database.db import engine
|
from agon.database.db import engine
|
||||||
from database.models import CategoryGroup
|
from agon.database.models import CategoryGroup
|
||||||
from utilities.utils import autofill_groups, send_highscore_message
|
from agon.utils import autofill_groups, send_highscore_message
|
||||||
|
|
||||||
|
|
||||||
class RefreshCog(commands.Cog, name="Refresh Cog"):
|
class RefreshCog(commands.Cog, name="Refresh Cog"):
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ from sqlalchemy import select
|
|||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from sqlmodel import col
|
from sqlmodel import col
|
||||||
|
|
||||||
from database.db import engine
|
from agon.database.db import engine
|
||||||
from database.models import Category, CategoryGroup, Guild
|
from agon.database.models import Category, CategoryGroup, Guild
|
||||||
from utilities.logger import agon_logger
|
from agon.logger import agon_logger
|
||||||
from utilities.utils import MAX_LINE_LENGTH, autofill_categories, autofill_groups, send_highscore_message
|
from agon.utils import MAX_LINE_LENGTH, autofill_categories, autofill_groups, send_highscore_message
|
||||||
|
|
||||||
|
|
||||||
class SetCog(commands.Cog, name="Set command."):
|
class SetCog(commands.Cog, name="Set command."):
|
||||||
|
|||||||
@@ -3,16 +3,16 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
import nextcord
|
import nextcord
|
||||||
from cogs.submission.verification_view import VerificationView
|
|
||||||
from database.db import engine
|
|
||||||
from database.models import Category, CategoryGroup, Guild, Submission
|
|
||||||
from nextcord.ext import commands
|
from nextcord.ext import commands
|
||||||
from sqlalchemy import select
|
from sqlalchemy import select
|
||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from sqlmodel import col
|
from sqlmodel import col
|
||||||
from utilities.utils import autofill_categories, autofill_groups, submit_score
|
|
||||||
|
|
||||||
from agon.app import agon_logger
|
from agon.cogs.submission.verification_view import VerificationView
|
||||||
|
from agon.database.db import engine
|
||||||
|
from agon.database.models import Category, CategoryGroup, Guild, Submission
|
||||||
|
from agon.logger import agon_logger
|
||||||
|
from agon.utils import autofill_categories, autofill_groups, submit_score
|
||||||
|
|
||||||
|
|
||||||
class SubmissionCog(commands.Cog):
|
class SubmissionCog(commands.Cog):
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ from sqlalchemy import select
|
|||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from sqlmodel import col
|
from sqlmodel import col
|
||||||
|
|
||||||
from database.db import engine
|
from agon.database.db import engine
|
||||||
from database.models import Guild
|
from agon.database.models import Guild
|
||||||
from utilities.utils import autofill_users_in_guild
|
from agon.utils import autofill_users_in_guild
|
||||||
|
|
||||||
from .views.update_username_verify import UpdateUsernameVerifyView
|
from .views.update_username_verify import UpdateUsernameVerifyView
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ from sqlalchemy import select
|
|||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from sqlmodel import col
|
from sqlmodel import col
|
||||||
|
|
||||||
from database.db import engine
|
from agon.database.db import engine
|
||||||
from database.models import Category, CategoryGroup, Score
|
from agon.database.models import Category, CategoryGroup, Score
|
||||||
from utilities.utils import MAX_LINE_LENGTH, autofill_categories, autofill_groups, format_score_string
|
from agon.utils import MAX_LINE_LENGTH, autofill_categories, autofill_groups, format_score_string
|
||||||
|
|
||||||
|
|
||||||
class ViewCog(commands.Cog, name="View Command"):
|
class ViewCog(commands.Cog, name="View Command"):
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import nextcord
|
|||||||
from sqlalchemy import delete, select
|
from sqlalchemy import delete, select
|
||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
|
|
||||||
from database.db import engine
|
from agon.database.db import engine
|
||||||
from database.models import Category, CategoryGroup
|
from agon.database.models import Category, CategoryGroup
|
||||||
from utilities.utils import send_highscore_message
|
from agon.utils import send_highscore_message
|
||||||
|
|
||||||
|
|
||||||
class DeleteConfirmView(nextcord.ui.Modal):
|
class DeleteConfirmView(nextcord.ui.Modal):
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ from sqlalchemy import distinct, exc, select
|
|||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from sqlmodel import col
|
from sqlmodel import col
|
||||||
|
|
||||||
from database.db import engine
|
from agon.database.db import engine
|
||||||
from database.models import Category, CategoryGroup, Score
|
from agon.database.models import Category, CategoryGroup, Score
|
||||||
from utilities.utils import send_highscore_message
|
from agon.utils import send_highscore_message
|
||||||
|
|
||||||
|
|
||||||
class UpdateUsernameVerifyView(nextcord.ui.View):
|
class UpdateUsernameVerifyView(nextcord.ui.View):
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ from sqlalchemy import select
|
|||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from sqlmodel import col
|
from sqlmodel import col
|
||||||
|
|
||||||
from database.db import engine
|
from agon.database.db import engine
|
||||||
from database.models import Guild
|
from agon.database.models import Guild
|
||||||
|
|
||||||
|
|
||||||
class GuildListener(commands.Cog, name="Guild Listener"):
|
class GuildListener(commands.Cog, name="Guild Listener"):
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ from sqlalchemy import select
|
|||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from sqlmodel import col
|
from sqlmodel import col
|
||||||
|
|
||||||
from database.db import engine
|
from agon.database.db import engine
|
||||||
from database.models import Guild
|
from agon.database.models import Guild
|
||||||
|
|
||||||
|
|
||||||
class GuildData(commands.Cog, name="Guild Data"):
|
class GuildData(commands.Cog, name="Guild Data"):
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ from sqlalchemy import delete, select
|
|||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from sqlmodel import col
|
from sqlmodel import col
|
||||||
|
|
||||||
from database.db import engine
|
from agon.database.db import engine
|
||||||
from database.models import Submission
|
from agon.database.models import Submission
|
||||||
from utilities.utils import submit_score
|
from agon.utils import submit_score
|
||||||
|
|
||||||
|
|
||||||
class VerificationView(nextcord.ui.View):
|
class VerificationView(nextcord.ui.View):
|
||||||
|
|||||||
+3
-2
@@ -1,8 +1,9 @@
|
|||||||
"""Simple file to set up the sqlmodel connection to database."""
|
"""Simple file to set up the sqlmodel connection to database."""
|
||||||
|
|
||||||
from sqlmodel import SQLModel, create_engine
|
from sqlmodel import SQLModel, create_engine
|
||||||
from utilities import config
|
|
||||||
from utilities.logger import agon_logger
|
from agon import config
|
||||||
|
from agon.logger import agon_logger
|
||||||
|
|
||||||
from . import models # noqa: F401 - Need this import for creating the models.
|
from . import models # noqa: F401 - Need this import for creating the models.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user