From 026fdacb5974f1957a4cb12d89b0148430b9e510 Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Wed, 13 Oct 2021 10:57:45 -0400 Subject: [PATCH] refactor PyInquirer to questionary --- maubot/cli/cliq/cliq.py | 8 ++++---- maubot/cli/commands/build.py | 2 +- requirements.txt | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/maubot/cli/cliq/cliq.py b/maubot/cli/cliq/cliq.py index 973587a..6a10e28 100644 --- a/maubot/cli/cliq/cliq.py +++ b/maubot/cli/cliq/cliq.py @@ -17,7 +17,7 @@ from typing import Any, Callable, Union, Optional import functools from prompt_toolkit.validation import Validator -from PyInquirer import prompt +from questionary import prompt import click from ..base import app @@ -48,7 +48,7 @@ def command(help: str) -> Callable[[Callable], Callable]: pass question_list = list(questions.values()) question_list.reverse() - resp = prompt(question_list, keyboard_interrupt_msg="Aborted!") + resp = prompt(question_list, kbi_msg="Aborted!") if not resp and question_list: return kwargs = {**kwargs, **resp} @@ -102,9 +102,9 @@ def option(short: str, long: str, message: str = None, help: str = None, if default is not None: q["default"] = default if required or required_unless is not None: - q["validator"] = Required(validator) + q["validate"] = Required(validator) elif validator: - q["validator"] = validator + q["validate"] = validator func.__inquirer_questions__[long[2:]] = q return func diff --git a/maubot/cli/commands/build.py b/maubot/cli/commands/build.py index a7b2fe1..4f5db2f 100644 --- a/maubot/cli/commands/build.py +++ b/maubot/cli/commands/build.py @@ -21,7 +21,7 @@ import os from ruamel.yaml import YAML, YAMLError from colorama import Fore -from PyInquirer import prompt +from questionary import prompt import click from mautrix.types import SerializerError diff --git a/requirements.txt b/requirements.txt index 136dc51..3420a56 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,5 +11,5 @@ packaging>=10 click>=7,<8 colorama>=0.4,<0.5 -PyInquirer>=1,<2 +questionary>=1,<2 jinja2>=2,<4