fix:优化pm2配置项

This commit is contained in:
Daniel
2026-03-05 19:53:05 +08:00
parent 004b03b374
commit 98d928f457
10 changed files with 125 additions and 10 deletions

View File

@@ -1,7 +1,21 @@
# -*- coding: utf-8 -*-
"""新闻分类与严重度判定"""
import re
from typing import Literal
from typing import List
try:
from typing import Literal # type: ignore
except ImportError:
try:
from typing_extensions import Literal # type: ignore
except ImportError:
from typing import Any
class _LiteralFallback:
def __getitem__(self, item):
return Any
Literal = _LiteralFallback()
Category = Literal["deployment", "alert", "intel", "diplomatic", "other"]
Severity = Literal["low", "medium", "high", "critical"]
@@ -13,7 +27,7 @@ CAT_INTEL = ["satellite", "intel", "image", "surveillance", "卫星", "情报"]
CAT_DIPLOMATIC = ["talk", "negotiation", "diplomat", "sanction", "谈判", "制裁"]
def _match(text: str, words: list[str]) -> bool:
def _match(text: str, words: List[str]) -> bool:
t = (text or "").lower()
for w in words:
if w.lower() in t: