aboutsummaryrefslogtreecommitdiff
path: root/tool/modules/config.py
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-11-28 17:35:11 +0800
committercrupest <crupest@outlook.com>2022-11-28 17:35:11 +0800
commitca998f2be058536349cc4ccb3060d9a17ea42b6c (patch)
tree500c7d1a1c44111f3ec5db7b3a230283597d268c /tool/modules/config.py
parent15d228d651dee7fa1653a76dffb95af6063cb8a9 (diff)
downloadcrupest-ca998f2be058536349cc4ccb3060d9a17ea42b6c.tar.gz
crupest-ca998f2be058536349cc4ccb3060d9a17ea42b6c.tar.bz2
crupest-ca998f2be058536349cc4ccb3060d9a17ea42b6c.zip
Add aio dns.
Diffstat (limited to 'tool/modules/config.py')
-rw-r--r--tool/modules/config.py5
1 files changed, 3 insertions, 2 deletions
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