From 60506eff9f855d8346d357499ca96759c2c8abb3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 31 Mar 2023 19:46:01 +0800 Subject: [PATCH] revert toolbox --- toolbox.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/toolbox.py b/toolbox.py index d657c1f..e50b973 100644 --- a/toolbox.py +++ b/toolbox.py @@ -237,10 +237,13 @@ def get_conf(*args): except: r = getattr(importlib.import_module('config'), arg) res.append(r) # 在读取API_KEY时,检查一下是不是忘了改config - assert arg != 'API_KEY' or len(r) == 51, "正确的API_KEY密钥是51位,请在config文件中修改API密钥, 添加海外代理之后再运行。" \ + if arg=='API_KEY' and len(r) != 51: + assert False, "正确的API_KEY密钥是51位,请在config文件中修改API密钥, 添加海外代理之后再运行。" + \ "(如果您刚更新过代码,请确保旧版config_private文件中没有遗留任何新增键值)" return res def clear_line_break(txt): - import re - return re.sub(r"\s+", " ", txt) \ No newline at end of file + txt = txt.replace('\n', ' ') + txt = txt.replace(' ', ' ') + txt = txt.replace(' ', ' ') + return txt \ No newline at end of file