| Total Complexity | 0 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | # -*- coding:utf-8 -*- |
||
| 2 | 1 | """ |
|
| 3 | Module for constants and types |
||
| 4 | """ |
||
| 5 | |||
| 6 | 1 | from typing import Union, List |
|
| 7 | |||
| 8 | 1 | from telebot.types import InlineKeyboardButton |
|
| 9 | |||
| 10 | 1 | InlineButtonData = Union[str, int, tuple, dict, InlineKeyboardButton] |
|
| 11 | 1 | button_text_types = (str, int) |
|
| 12 | 1 | ButtonText = Union[button_text_types] |
|
| 13 | 1 | callback_data_types = (str, int, type(None)) |
|
| 14 | 1 | CallbackDataMarker = Union[callback_data_types] |
|
| 15 | |||
| 16 | # structureless sequence of InlineButtonData objects |
||
| 17 | 1 | FlatSequence = List[InlineButtonData] |
|
| 18 | |||
| 19 | # structured sequence of InlineButtonData objects |
||
| 20 | 1 | StructuredSequence = List[Union[FlatSequence, InlineButtonData]] |
|
| 21 | |||
| 22 | # unified type that allows you to use any available data types for the keyboard |
||
| 23 | 1 | BlockItems = Union[StructuredSequence, InlineButtonData] |
|
| 24 | |||
| 25 | 1 | MAXIMUM_ITEMS_IN_KEYBOARD = 100 |
|
| 26 | 1 | MAXIMUM_ITEMS_IN_LINE = 8 |
|
| 27 | 1 | MINIMUM_ITEMS_IN_LINE = 1 |
|
| 28 | 1 | DEFAULT_ITEMS_IN_LINE = MINIMUM_ITEMS_IN_LINE |
|
| 29 | 1 | AUTO_ALIGNMENT_RANGE = range(3, 6) |
|
| 30 | MAXIMUM_CBD_LENGTH = 64 |
||
| 31 |