diff options
author | crupest <crupest@outlook.com> | 2023-05-31 23:55:57 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2023-05-31 23:55:57 +0800 |
commit | 4cc25bea963c09a1eb0f951bed1eabc75d196446 (patch) | |
tree | 2f5aa4fe9684a19463255b454162cc84d35ccc2a /tool/modules/config.py | |
parent | 4e6260b7d03a38be65203139631d5fda523e80af (diff) | |
download | crupest-4cc25bea963c09a1eb0f951bed1eabc75d196446.tar.gz crupest-4cc25bea963c09a1eb0f951bed1eabc75d196446.tar.bz2 crupest-4cc25bea963c09a1eb0f951bed1eabc75d196446.zip |
Add v2ray.
Diffstat (limited to 'tool/modules/config.py')
-rw-r--r-- | tool/modules/config.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tool/modules/config.py b/tool/modules/config.py index 534ce30..40b20d1 100644 --- a/tool/modules/config.py +++ b/tool/modules/config.py @@ -1,10 +1,11 @@ -import pwd -import grp import os import typing +import uuid from rich.prompt import Prompt from .path import config_file_path +def generate_uuid(): + return str(uuid.uuid4()) class ConfigVar: def __init__(self, name: str, description: str, default_value_generator: typing.Callable[[], str] | str, /, default_value_for_ask=str | None): @@ -48,6 +49,12 @@ config_var_list: list = [ "github token for fetching todos", "Please input your github token for fetching todos"), ConfigVar("CRUPEST_GITHUB_TODO_COUNT", "github todo count", "Please input your github todo count", 10), + ConfigVar("CRUPEST_GITHUB_TODO_COUNT", + "github todo count", "Please input your github todo count", 10), + ConfigVar("CRUPEST_V2RAY_TOKEN", + "v2ray user id", generate_uuid), + ConfigVar("CRUPEST_V2RAY_PATH", + "v2ray path, which will be prefixed by _", generate_uuid), ] config_var_name_set = set([config_var.name for config_var in config_var_list]) |