Beispiel #1
0
 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
Beispiel #2
0
 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
Beispiel #3
0
 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
Beispiel #4
0
def dialogs(lang):
    return Button('BUTTON.DIALOGS', CommandInfo('keyboard',
                                                ['dialogs'])).localize(lang)
Beispiel #5
0
def start(lang):
    return Button('BUTTON.START', CommandInfo('empty')).localize(lang)
Beispiel #6
0
def unreg(lang):
    return Button('BUTTON.UNREG', CommandInfo('unreg')).localize(lang)
Beispiel #7
0
def new_dialog(lang):
    return Button('BUTTON.NEW_DIALOG',
                  CommandInfo('keyboard', ['messengers'])).localize(lang)
Beispiel #8
0
def help(lang):
    return Button('BUTTON.HELP', CommandInfo('help')).localize(lang)
Beispiel #9
0
def lang(lang):
    return Button('BUTTON.LANG', CommandInfo('keyboard',
                                             ['lang'])).localize(lang)
Beispiel #10
0
def off(lang):
    return Button('BUTTON.OFF', CommandInfo('off')).localize(lang)
Beispiel #11
0
def settings(lang):
    return Button('BUTTON.SETTINGS', CommandInfo('keyboard',
                                                 ['settings'])).localize(lang)
Beispiel #12
0
 def keyboard(self):
     return Keyboard(
         [[Button(self.get_text('continue'), lambda: 'gameplay')]])
Beispiel #13
0
 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')),
     ]])
Beispiel #14
0
 def keyboard(self):
     return Keyboard([[Button(self.get_text('button'), lambda: 'intro')]])