Skip to content

Commit cce1b98

Browse files
committed
Fix circular import
1 parent 4e40ae1 commit cce1b98

File tree

4 files changed

+12
-19
lines changed

4 files changed

+12
-19
lines changed

src/entities/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from .constants import ADMINS, POSTGRES_PASSWORD, POSTGRES_USER, TEXT, TOKEN
22
from .create_bot import bot
3-
from .dispatcher import dp
43
from .fsm import States, storage
54
from .logs import logger
65
from .utils import get_keyboard, get_update_user_info, log_error
76

87
__all__ = ["TOKEN", "POSTGRES_USER", "POSTGRES_PASSWORD", "ADMINS", "TEXT",
9-
"States", "get_update_user_info", "storage", "bot", "dp",
8+
"States", "get_update_user_info", "storage", "bot",
109
"log_error", "get_keyboard", "logger"]

src/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import asyncio
22

3-
from entities import bot, dp
3+
from entities import bot
4+
from routers import dp
45

56

67
async def main():

src/routers/__init__.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
from .check_cert import router as check_cert_router
2-
from .check_count import router as check_count_router
3-
from .create_cert import router as create_cert_router
4-
from .index import router as index_router
5-
from .link import router as link_router
6-
from .utility import router as utility_router
1+
from .dispatcher import dp
72

8-
__all__ = ["index_router", "link_router", "utility_router",
9-
"create_cert_router", "check_cert_router", "check_count_router"]
3+
__all__ = ["dp"]

src/entities/dispatcher.py renamed to src/routers/dispatcher.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55

66
from entities import get_update_user_info, storage
77
from models import User
8-
from routers import (
9-
check_cert_router,
10-
check_count_router,
11-
create_cert_router,
12-
index_router,
13-
link_router,
14-
utility_router,
15-
)
8+
9+
from .check_cert import router as check_cert_router
10+
from .check_count import router as check_count_router
11+
from .create_cert import router as create_cert_router
12+
from .index import router as index_router
13+
from .link import router as link_router
14+
from .utility import router as utility_router
1615

1716
dp = Dispatcher(storage=storage)
1817

0 commit comments

Comments
 (0)