labpack/messaging/telegram.py
def _compile_buttons(self, button_list, small_buttons, persist_buttons):

        ''' a helper method to compile buttons to telegram api format

        :param button_list: list of strings with button values
        :param small_buttons: boolean to resize buttons to fit text size
        :param persist_buttons: boolean to keep buttons around after exiting
        :return: string in json serial format
        '''

        import json
        keyboard_list = []
        for item in button_list:
            keyboard_list.append([{'text': item}])
        keyboard_kwargs = {
            'keyboard': keyboard_list,
            'one_time_keyboard': not persist_buttons,
            'resize_keyboard': small_buttons
        }
        json_data = json.dumps(keyboard_kwargs)
        return json_data
 a helper method to compile buttons to telegram api format

        :param button_list: list of strings with button values
        :param small_buttons: boolean to resize buttons to fit text size
        :param persist_buttons: boolean to keep buttons around after exiting
        :return: string in json serial format
        
a helper method to compile buttons to telegram api format
a helper method to compile buttons to telegram api format
def _compile_buttons(self, button_list, small_buttons, persist_buttons):
        import json
        keyboard_list = []
        for item in button_list:
            keyboard_list.append([{'text': item}])
        keyboard_kwargs = {
            'keyboard': keyboard_list,
            'one_time_keyboard': not persist_buttons,
            'resize_keyboard': small_buttons
        }
        json_data = json.dumps(keyboard_kwargs)
        return json_data
def _compile_buttons ( self , button_list , small_buttons , persist_buttons ) : import json keyboard_list = [ ] for item in button_list : keyboard_list . append ( [ { 'text' : item } ] ) keyboard_kwargs = { 'keyboard' : keyboard_list , 'one_time_keyboard' : not persist_buttons , 'resize_keyboard' : small_buttons } json_data = json . dumps ( keyboard_kwargs ) return json_data
a helper method to compile buttons to telegram api format
a helper method to compile buttons to telegram api format
''' a helper method to compile buttons to telegram api format

        :param button_list: list of strings with button values
        :param small_buttons: boolean to resize buttons to fit text size
        :param persist_buttons: boolean to keep buttons around after exiting
        :return: string in json serial format
        '''
string in json serial format
string in json serial format
self
button_list
list of strings with button values
list of strings with button values
small_buttons
boolean to resize buttons to fit text size
boolean to resize buttons to fit text size
persist_buttons
boolean to keep buttons around after exiting
boolean to keep buttons around after exiting