gapfill G3: unify all 5 private row_get onto peer_messages.row_get (approvals, automations, marker_tools, todos, wait_ops; resident import retargeted); semantics identical on None/dict/sqlite3.Row, identity tests added
This commit is contained in:
1 parent
5ca642c86e
commit
aa6179b5e1
7 files changed
+58
-52
No files matched your search
+5
-9
@@ -27,8 +27,9 @@ pending / in_progress / blocked / completed / cancelled,
|
||||
一个项目里多人并行,多项 in_progress 是正常态,强制
|
||||
单一会把板子变成单人队列,所以这里不做互斥。
|
||||
|
||||
本模块只依赖标准库,不 import cloud 其它模块,避免循环
|
||||
import;表迁移写法仿 automations(CREATE TABLE IF NOT
|
||||
本模块除行取值复用 cloud.peer_messages(该模块本身只依赖
|
||||
标准库,故不产生循环 import)外不 import cloud 其它模块;
|
||||
表迁移写法仿 automations(CREATE TABLE IF NOT
|
||||
EXISTS + 查列补齐,SQLite 与 Postgres 适配层同款:调用方
|
||||
仍写 ? 占位符,db.py 适配层转 PG 方言)。
|
||||
"""
|
||||
@@ -36,6 +37,8 @@ EXISTS + 查列补齐,SQLite 与 Postgres 适配层同款:调用方
|
||||
import time
|
||||
import uuid
|
||||
|
||||
from cloud.peer_messages import row_get
|
||||
|
||||
STATUSES = ("pending", "in_progress", "blocked", "completed", "cancelled")
|
||||
PRIORITIES = ("low", "medium", "high")
|
||||
MAX_TITLE_LEN = 500
|
||||
@@ -47,13 +50,6 @@ TODO_COLUMNS = (
|
||||
"updated_at", "completed_at")
|
||||
|
||||
|
||||
def row_get(row, name):
|
||||
try:
|
||||
return row[name]
|
||||
except (KeyError, IndexError, TypeError):
|
||||
return None
|
||||
|
||||
|
||||
def _row_dict(row, columns):
|
||||
if row is None or isinstance(row, dict):
|
||||
return row
|
||||
|
||||
Reference in new issue
Block a user