fix: auto-fix code issues (cron)
- 修复重复导入/字段 - 修复异常处理 - 修复PEP8格式问题 - 添加类型注解
This commit is contained in:
@@ -123,7 +123,7 @@ class DatabaseManager:
|
||||
conn.row_factory = sqlite3.Row
|
||||
return conn
|
||||
|
||||
def init_db(self):
|
||||
def init_db(self) -> None:
|
||||
"""初始化数据库表"""
|
||||
with open(os.path.join(os.path.dirname(__file__), "schema.sql")) as f:
|
||||
schema = f.read()
|
||||
@@ -299,7 +299,7 @@ class DatabaseManager:
|
||||
conn.close()
|
||||
return self.get_entity(entity_id)
|
||||
|
||||
def delete_entity(self, entity_id: str):
|
||||
def delete_entity(self, entity_id: str) -> None:
|
||||
"""删除实体及其关联数据"""
|
||||
conn = self.get_conn()
|
||||
conn.execute("DELETE FROM entity_mentions WHERE entity_id = ?", (entity_id,))
|
||||
|
||||
Reference in New Issue
Block a user