diff options
author | Lint Action <[email protected]> | 2021-05-04 06:29:07 +0000 |
---|---|---|
committer | Lint Action <[email protected]> | 2021-05-04 06:29:07 +0000 |
commit | 8804f1e10d507ba293fafc77a7e93d3a84a5814b (patch) | |
tree | e107da61f76dfe64dfb96feb5e961bbc4bbd8d52 /ATRI/config.py | |
parent | ea7f48011c34fdaec7e91af7eb373c8174e439e6 (diff) | |
download | ATRI-8804f1e10d507ba293fafc77a7e93d3a84a5814b.tar.gz ATRI-8804f1e10d507ba293fafc77a7e93d3a84a5814b.tar.bz2 ATRI-8804f1e10d507ba293fafc77a7e93d3a84a5814b.zip |
:rotating_light: 自动进行代码格式化
Diffstat (limited to 'ATRI/config.py')
-rw-r--r-- | ATRI/config.py | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/ATRI/config.py b/ATRI/config.py index f76a54a..ca86e90 100644 --- a/ATRI/config.py +++ b/ATRI/config.py @@ -5,58 +5,58 @@ from ipaddress import IPv4Address from .utils.yaml import load_yml -CONFIG_PATH = Path('.') / 'config.yml' +CONFIG_PATH = Path(".") / "config.yml" config = load_yml(CONFIG_PATH) class BotSelfConfig: - config: dict = config['BotSelfConfig'] - - host: IPv4Address = IPv4Address(config.get('host', '127.0.0.1')) - port: int = int(config.get('port', 8080)) - debug: bool = bool(config.get('debug', False)) - superusers: set = set(config.get('superusers', ['1234567890'])) - nickname: set = set( - config.get('nickname', ['ATRI', 'Atri', 'atri', '亚托莉', 'アトリ'])) - command_start: set = set(config.get('command_start', [''])) - command_sep: set = set(config.get('command_sep', ['.'])) - session_expire_timeout: timedelta = timedelta(seconds= - config.get('session_expire_timeout', 60)) + config: dict = config["BotSelfConfig"] + + host: IPv4Address = IPv4Address(config.get("host", "127.0.0.1")) + port: int = int(config.get("port", 8080)) + debug: bool = bool(config.get("debug", False)) + superusers: set = set(config.get("superusers", ["1234567890"])) + nickname: set = set(config.get("nickname", ["ATRI", "Atri", "atri", "亚托莉", "アトリ"])) + command_start: set = set(config.get("command_start", [""])) + command_sep: set = set(config.get("command_sep", ["."])) + session_expire_timeout: timedelta = timedelta( + seconds=config.get("session_expire_timeout", 60) + ) class NetworkPost: - config: dict = config['NetworkPost'] - - host: str = config.get('host', '127.0.0.1') - port: int = int(config.get('port', 8081)) + config: dict = config["NetworkPost"] + + host: str = config.get("host", "127.0.0.1") + port: int = int(config.get("port", 8081)) class AdminPage: - config: dict = config['AdminPage'] - - host: str = config.get('host', '127.0.0.1') - port: int = int(config.get('port', 8082)) + config: dict = config["AdminPage"] + + host: str = config.get("host", "127.0.0.1") + port: int = int(config.get("port", 8082)) class NsfwCheck: - config: dict = config['NsfwCheck'] - - enabled: bool = bool(config.get('enabled', False)) - passing_rate: int = int(config.get('passing_rate', 85)) - host: str = config.get('host', '127.0.0.1') - port: int = int(config.get('port', 5000)) + config: dict = config["NsfwCheck"] + + enabled: bool = bool(config.get("enabled", False)) + passing_rate: int = int(config.get("passing_rate", 85)) + host: str = config.get("host", "127.0.0.1") + port: int = int(config.get("port", 5000)) class SauceNAO: - config: dict = config['SauceNAO'] - - key: str = config.get('key', '') + config: dict = config["SauceNAO"] + + key: str = config.get("key", "") class Setu: - config: dict = config['Setu'] - - key: str = config.get('key', '') + config: dict = config["Setu"] + + key: str = config.get("key", "") RUNTIME_CONFIG = { @@ -67,5 +67,5 @@ RUNTIME_CONFIG = { "nickname": BotSelfConfig.nickname, "command_start": BotSelfConfig.command_start, "command_sep": BotSelfConfig.command_sep, - "session_expire_timeout": BotSelfConfig.session_expire_timeout + "session_expire_timeout": BotSelfConfig.session_expire_timeout, } |