How to use the questionary.utils function in questionary

To help you get started, we’ve selected a few questionary 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 tmbo / questionary / tests / test_utils.py View on Github external
def test_default_values_of():
    def f(a, b=2, c=None, *args, **kwargs):
        pass

    defaults = utils.default_values_of(f)
    assert defaults == ["b", "c", "args", "kwargs"]
github tmbo / questionary / questionary / question.py View on Github external
async def unsafe_ask_async(self, patch_stdout: bool = False) -> Any:
        """Ask the question using asyncio and return user response.

        Does not catch keyboard interrupts."""

        if not utils.ACTIVATED_ASYNC_MODE:
            await utils.activate_prompt_toolkit_async_mode()

        if patch_stdout:
            # with prompt_toolkit.patch_stdout.patch_stdout():
            return await self.application.run_async().to_asyncio_future()
        else:
            return await self.application.run_async().to_asyncio_future()
github tmbo / questionary / questionary / question.py View on Github external
async def unsafe_ask_async(self, patch_stdout: bool = False) -> Any:
        """Ask the question using asyncio and return user response.

        Does not catch keyboard interrupts."""

        if not utils.ACTIVATED_ASYNC_MODE:
            await utils.activate_prompt_toolkit_async_mode()

        if patch_stdout:
            # with prompt_toolkit.patch_stdout.patch_stdout():
            return await self.application.run_async().to_asyncio_future()
        else:
            return await self.application.run_async().to_asyncio_future()