|
@@ -239,13 +239,10 @@ def do_check() -> int:
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
|
- # 控制台可能是 GBK (Windows 中文默认 936): 正文里的 ✔/✘ 等符号编不出来会直接抛 UnicodeEncodeError
|
|
|
|
|
- # (校验结论明明通过了却因为 print 崩掉, 退出码变成 1)。降级为 '?' 而不是崩。
|
|
|
|
|
- for _s in (sys.stdout, sys.stderr):
|
|
|
|
|
- try:
|
|
|
|
|
- _s.reconfigure(errors='replace')
|
|
|
|
|
- except Exception:
|
|
|
|
|
- pass
|
|
|
|
|
|
|
+ # 控制台可能是 GBK (Windows 中文默认 936): 正文里的 ✔/✘ 编不出来会直接抛 UnicodeEncodeError
|
|
|
|
|
+ # (校验结论明明通过了却因为 print 崩掉, 退出码变成 1)。降级为 '?' 而不是崩。见 src/console.py。
|
|
|
|
|
+ from src import console
|
|
|
|
|
+ console.soft()
|
|
|
ap = argparse.ArgumentParser()
|
|
ap = argparse.ArgumentParser()
|
|
|
g = ap.add_mutually_exclusive_group()
|
|
g = ap.add_mutually_exclusive_group()
|
|
|
g.add_argument('--extract', action='store_true', help='从现有 portal.html 拆出 portal_src/ (一次性)')
|
|
g.add_argument('--extract', action='store_true', help='从现有 portal.html 拆出 portal_src/ (一次性)')
|