fixed wrong typings

This commit is contained in:
Forden 2021-04-17 01:01:56 +03:00
parent b670de879a
commit 407942027b
2 changed files with 4 additions and 4 deletions

4
bot.py
View File

@ -1,4 +1,4 @@
from typing import List from typing import List, Tuple
import aiojobs as aiojobs import aiojobs as aiojobs
from aiogram import Bot, Dispatcher from aiogram import Bot, Dispatcher
@ -34,7 +34,7 @@ async def init() -> web.Application:
logging.setup() logging.setup()
scheduler = await aiojobs.create_scheduler() scheduler = await aiojobs.create_scheduler()
app = web.Application() app = web.Application()
subapps: List[str, web.Application] = [ subapps: List[Tuple[str, web.Application]] = [
('/tg/webhooks/', web_handlers.tg_updates_app), ('/tg/webhooks/', web_handlers.tg_updates_app),
] ]
for prefix, subapp in subapps: for prefix, subapp in subapps:

View File

@ -1,12 +1,12 @@
from typing import List, Union from typing import List, Union
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup, KeyboardButton, ReplyKeyboardMarkup from aiogram.types import InlineKeyboardButton, KeyboardButton
def create_keyboard_layout( def create_keyboard_layout(
buttons: List[Union[InlineKeyboardButton, KeyboardButton]], buttons: List[Union[InlineKeyboardButton, KeyboardButton]],
count: List[int] count: List[int]
) -> Union[InlineKeyboardMarkup, ReplyKeyboardMarkup]: ) -> List[List[Union[InlineKeyboardButton, KeyboardButton]]]:
if sum(count) != len(buttons): if sum(count) != len(buttons):
raise ValueError('Количество кнопок не совпадает со схемой') raise ValueError('Количество кнопок не совпадает со схемой')
tmplist = [] tmplist = []