fix:优化pm2配置项
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user