fix: auto-fix code issues (cron)

- 修复重复导入/字段
- 修复异常处理
- 修复PEP8格式问题
- 添加类型注解
This commit is contained in:
OpenClaw Bot
2026-02-28 09:11:38 +08:00
parent 210cae132f
commit 74c2daa5ef
37 changed files with 1135 additions and 1145 deletions

View File

@@ -14,7 +14,6 @@ from datetime import datetime
DB_PATH = os.getenv("DB_PATH", "/app/data/insightflow.db")
@dataclass
class Project:
id: str
@@ -23,7 +22,6 @@ class Project:
created_at: str = ""
updated_at: str = ""
@dataclass
class Entity:
id: str
@@ -44,7 +42,6 @@ class Entity:
if self.attributes is None:
self.attributes = {}
@dataclass
class AttributeTemplate:
"""属性模板定义"""
@@ -65,7 +62,6 @@ class AttributeTemplate:
if self.options is None:
self.options = []
@dataclass
class EntityAttribute:
"""实体属性值"""
@@ -86,7 +82,6 @@ class EntityAttribute:
if self.options is None:
self.options = []
@dataclass
class AttributeHistory:
"""属性变更历史"""
@@ -100,7 +95,6 @@ class AttributeHistory:
changed_at: str = ""
change_reason: str = ""
@dataclass
class EntityMention:
id: str
@@ -111,7 +105,6 @@ class EntityMention:
text_snippet: str
confidence: float = 1.0
class DatabaseManager:
def __init__(self, db_path: str = DB_PATH):
self.db_path = db_path
@@ -1392,11 +1385,9 @@ class DatabaseManager:
conn.close()
return stats
# Singleton instance
_db_manager = None
def get_db_manager() -> DatabaseManager:
global _db_manager
if _db_manager is None: