Exemple #1
0
def start_loop(supbot: Supbot):
    """
    Waits for input, then processes the input when entered
    loops till supbot is running

    :param supbot: supbot service
    """
    while supbot.is_on():
        request = input(">")
        process(supbot, request)
Exemple #2
0
def start_loop(supbot: Supbot, no_prompt: bool):
    """
    Waits for input, then processes the input when entered
    loops till supbot is running

    :param no_prompt:
    :param supbot: supbot service
    """
    while not supbot.has_started():
        time.sleep(0.5)

    print(help_me)

    def get_input():
        with patch_stdout():
            while supbot.is_on():
                yield prompt("> ")

    while supbot.is_on():
        request = input("> ") if no_prompt else next(get_input())
        process(supbot, request)