From ca998f2be058536349cc4ccb3060d9a17ea42b6c Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 28 Nov 2022 17:35:11 +0800 Subject: Add aio dns. --- tool/modules/config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tool/modules/config.py') diff --git a/tool/modules/config.py b/tool/modules/config.py index 28b09a3..b9ad818 100644 --- a/tool/modules/config.py +++ b/tool/modules/config.py @@ -1,18 +1,19 @@ import pwd import grp import os +import typing from rich.prompt import Prompt from .path import config_file_path class ConfigVar: - def __init__(self, name: str, description: str, default_value_generator, /, default_value_for_ask=None): + def __init__(self, name: str, description: str, default_value_generator: typing.Callable[[], str] | str, /, default_value_for_ask=str | None): """Create a config var. Args: name (str): The name of the config var. description (str): The description of the config var. - default_value_generator (typing.Callable([], str) | str): The default value generator of the config var. If it is a string, it will be used as the input prompt and let user input the value. + default_value_generator (typing.Callable[[], str] | str): The default value generator of the config var. If it is a string, it will be used as the input prompt and let user input the value. """ self.name = name self.description = description -- cgit v1.2.3