How to use the tartube.dialogue.MessageDialogue function in tartube

To help you get started, we’ve selected a few tartube examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github axcore / tartube / tartube / dialogue.py View on Github external
# Rationalise the message. First, split the string into a list of
        #   lines, preserving \n\n (but not a standalone \n)
        line_list = msg.split('\n\n')
        # In each line, convert any standalone \n characters to whitespace.
        #   Then add new newline characters, if required, to give a maximum
        #   length per line
        mod_list = []
        for line in line_list:
            mod_list.append(utils.tidy_up_long_string(line, 40))

        # Finally combine everything into a single string, as before
        double = '\n\n'
        msg = double.join(mod_list)

        # ...and display the message dialogue
        dialogue_win = MessageDialogue(
            self,
            msg,
            msg_type,
            button_type,
            parent_win_obj,
            response_dict,
        )

        dialogue_win.create_dialogue()

        return dialogue_win