def buttons(self): for i, lang in enumerate(l10n.locales): yield Button(lang, CommandInfo('lang', [lang])) if i % 2 > 0: yield if len(l10n.locales) % 2 != 0: yield
def buttons(self): all_messengers = messengers.get_available_messengers() for i, messenger in enumerate(all_messengers): yield Button(messenger, CommandInfo('chat', [messenger])) if i % 2 > 0: yield if len(all_messengers) % 2 != 0: yield
def buttons(self): connections = self.owner.connections print(connections) for i, con in enumerate(connections): yield Button(f'{con.name} ({con.messenger})', CommandInfo('chat', [con.messenger, con.id])) if i % 2 > 0: yield if len(connections) % 2 != 0: yield
def dialogs(lang): return Button('BUTTON.DIALOGS', CommandInfo('keyboard', ['dialogs'])).localize(lang)
def start(lang): return Button('BUTTON.START', CommandInfo('empty')).localize(lang)
def unreg(lang): return Button('BUTTON.UNREG', CommandInfo('unreg')).localize(lang)
def new_dialog(lang): return Button('BUTTON.NEW_DIALOG', CommandInfo('keyboard', ['messengers'])).localize(lang)
def help(lang): return Button('BUTTON.HELP', CommandInfo('help')).localize(lang)
def lang(lang): return Button('BUTTON.LANG', CommandInfo('keyboard', ['lang'])).localize(lang)
def off(lang): return Button('BUTTON.OFF', CommandInfo('off')).localize(lang)
def settings(lang): return Button('BUTTON.SETTINGS', CommandInfo('keyboard', ['settings'])).localize(lang)
def keyboard(self): return Keyboard( [[Button(self.get_text('continue'), lambda: 'gameplay')]])
def keyboard(self): return Keyboard([[ Button(self.get_text('button_ru'), lambda: self.set_language('ru')), ], [ Button(self.get_text('button_en'), lambda: self.set_language('en')), ]])
def keyboard(self): return Keyboard([[Button(self.get_text('button'), lambda: 'intro')]])