style: auto-format code with ruff (cron)
This commit is contained in:
@@ -263,7 +263,7 @@ class CollaborationManager:
|
||||
"""
|
||||
SELECT * FROM project_shares WHERE token = ?
|
||||
""",
|
||||
(token, ),
|
||||
(token,),
|
||||
)
|
||||
row = cursor.fetchone()
|
||||
|
||||
@@ -300,7 +300,7 @@ class CollaborationManager:
|
||||
SET use_count = use_count + 1
|
||||
WHERE token = ?
|
||||
""",
|
||||
(token, ),
|
||||
(token,),
|
||||
)
|
||||
self.db.conn.commit()
|
||||
|
||||
@@ -314,7 +314,7 @@ class CollaborationManager:
|
||||
SET is_active = 0
|
||||
WHERE id = ?
|
||||
""",
|
||||
(share_id, ),
|
||||
(share_id,),
|
||||
)
|
||||
self.db.conn.commit()
|
||||
return cursor.rowcount > 0
|
||||
@@ -332,7 +332,7 @@ class CollaborationManager:
|
||||
WHERE project_id = ?
|
||||
ORDER BY created_at DESC
|
||||
""",
|
||||
(project_id, ),
|
||||
(project_id,),
|
||||
)
|
||||
|
||||
shares = []
|
||||
@@ -510,7 +510,7 @@ class CollaborationManager:
|
||||
def _get_comment_by_id(self, comment_id: str) -> Comment | None:
|
||||
"""根据ID获取评论"""
|
||||
cursor = self.db.conn.cursor()
|
||||
cursor.execute("SELECT * FROM comments WHERE id = ?", (comment_id, ))
|
||||
cursor.execute("SELECT * FROM comments WHERE id = ?", (comment_id,))
|
||||
row = cursor.fetchone()
|
||||
if row:
|
||||
return self._row_to_comment(row)
|
||||
@@ -773,7 +773,7 @@ class CollaborationManager:
|
||||
"""
|
||||
SELECT COUNT(*) FROM change_history WHERE project_id = ?
|
||||
""",
|
||||
(project_id, ),
|
||||
(project_id,),
|
||||
)
|
||||
total_changes = cursor.fetchone()[0]
|
||||
|
||||
@@ -783,7 +783,7 @@ class CollaborationManager:
|
||||
SELECT change_type, COUNT(*) FROM change_history
|
||||
WHERE project_id = ? GROUP BY change_type
|
||||
""",
|
||||
(project_id, ),
|
||||
(project_id,),
|
||||
)
|
||||
type_counts = {row[0]: row[1] for row in cursor.fetchall()}
|
||||
|
||||
@@ -793,7 +793,7 @@ class CollaborationManager:
|
||||
SELECT entity_type, COUNT(*) FROM change_history
|
||||
WHERE project_id = ? GROUP BY entity_type
|
||||
""",
|
||||
(project_id, ),
|
||||
(project_id,),
|
||||
)
|
||||
entity_type_counts = {row[0]: row[1] for row in cursor.fetchall()}
|
||||
|
||||
@@ -806,7 +806,7 @@ class CollaborationManager:
|
||||
ORDER BY count DESC
|
||||
LIMIT 5
|
||||
""",
|
||||
(project_id, ),
|
||||
(project_id,),
|
||||
)
|
||||
top_contributors = [{"name": row[0], "changes": row[1]} for row in cursor.fetchall()]
|
||||
|
||||
@@ -902,7 +902,7 @@ class CollaborationManager:
|
||||
SELECT * FROM team_members WHERE project_id = ?
|
||||
ORDER BY joined_at ASC
|
||||
""",
|
||||
(project_id, ),
|
||||
(project_id,),
|
||||
)
|
||||
|
||||
members = []
|
||||
@@ -949,7 +949,7 @@ class CollaborationManager:
|
||||
return False
|
||||
|
||||
cursor = self.db.conn.cursor()
|
||||
cursor.execute("DELETE FROM team_members WHERE id = ?", (member_id, ))
|
||||
cursor.execute("DELETE FROM team_members WHERE id = ?", (member_id,))
|
||||
self.db.conn.commit()
|
||||
return cursor.rowcount > 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user