mirror of
https://github.com/Balshgit/mosgortrans.git
synced 2025-09-11 13:00:40 +03:00
refactor app
This commit is contained in:
parent
bad1d79fcf
commit
295cc89853
@ -6,13 +6,14 @@ from aiogram.dispatcher import Dispatcher
|
|||||||
from aiogram.dispatcher.webhook import SendMessage
|
from aiogram.dispatcher.webhook import SendMessage
|
||||||
from aiogram.utils.callback_data import CallbackData
|
from aiogram.utils.callback_data import CallbackData
|
||||||
|
|
||||||
from core.parse_web import parse_site, configure_firefox_driver
|
from core.parse_web import parse_site, configure_firefox_driver, download_gecko_driver
|
||||||
from settings import API_TOKEN
|
from settings import API_TOKEN
|
||||||
|
|
||||||
bot = Bot(token=API_TOKEN)
|
bot = Bot(token=API_TOKEN)
|
||||||
dispatcher = Dispatcher(bot)
|
dispatcher = Dispatcher(bot)
|
||||||
dispatcher.middleware.setup(LoggingMiddleware())
|
dispatcher.middleware.setup(LoggingMiddleware())
|
||||||
|
|
||||||
|
download_gecko_driver()
|
||||||
driver = configure_firefox_driver()
|
driver = configure_firefox_driver()
|
||||||
|
|
||||||
stations_cb = CallbackData('station', 'direction')
|
stations_cb = CallbackData('station', 'direction')
|
||||||
|
3
app/delete.py
Normal file
3
app/delete.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
print(Path(__file__).parent.parent)
|
@ -2,7 +2,6 @@ from aiogram.utils.executor import start_webhook
|
|||||||
|
|
||||||
from core.bot import bot, dispatcher
|
from core.bot import bot, dispatcher
|
||||||
from core.logger import logger
|
from core.logger import logger
|
||||||
from core.parse_web import download_gecko_driver
|
|
||||||
from core.scheduler import asyncio_schedule
|
from core.scheduler import asyncio_schedule
|
||||||
from settings import WEBHOOK_URL, WEBHOOK_PATH, WEBAPP_HOST, WEBAPP_PORT
|
from settings import WEBHOOK_URL, WEBHOOK_PATH, WEBAPP_HOST, WEBAPP_PORT
|
||||||
|
|
||||||
@ -26,7 +25,6 @@ async def on_shutdown(dispatcher):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
download_gecko_driver()
|
|
||||||
|
|
||||||
start_webhook(
|
start_webhook(
|
||||||
dispatcher=dispatcher,
|
dispatcher=dispatcher,
|
||||||
|
@ -4,7 +4,7 @@ from decouple import AutoConfig
|
|||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR.joinpath('some')
|
# Build paths inside the project like this: BASE_DIR.joinpath('some')
|
||||||
# `pathlib` is better than writing: dirname(dirname(dirname(__file__)))
|
# `pathlib` is better than writing: dirname(dirname(dirname(__file__)))
|
||||||
BASE_DIR = Path(__file__).parent.parent
|
BASE_DIR = Path(__file__).parent
|
||||||
|
|
||||||
# Loading `.env` files
|
# Loading `.env` files
|
||||||
# See docs: https://gitlab.com/mkleehammer/autoconfig
|
# See docs: https://gitlab.com/mkleehammer/autoconfig
|
||||||
|
Loading…
x
Reference in New Issue
Block a user