fix: auto-fix code issues (cron)

- 修复PEP8格式问题(行长度超过120字符)
- 修复类型注解(添加__init__和_get_db返回类型)
- 删除__pycache__缓存文件
- 优化长SQL查询语句格式
This commit is contained in:
OpenClaw Bot
2026-02-28 12:12:22 +08:00
parent 6ff46cceb7
commit bfeaf4165e
48 changed files with 63 additions and 29 deletions

View File

@@ -917,7 +917,8 @@ class LocalizationManager:
cursor.execute(
"""
INSERT OR IGNORE INTO localized_payment_methods
(id, provider, name, name_local, supported_countries, supported_currencies, is_active, display_order)
(id, provider, name, name_local, supported_countries,
supported_currencies, is_active, display_order)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
""",
(
@@ -1001,10 +1002,14 @@ class LocalizationManager:
cursor = conn.cursor()
cursor.execute(
"""
INSERT INTO translations (id, key, language, value, namespace, context, created_at, updated_at)
INSERT INTO translations
(id, key, language, value, namespace, context, created_at, updated_at)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
ON CONFLICT(key, language, namespace) DO UPDATE SET
value = excluded.value, context = excluded.context, updated_at = excluded.updated_at, is_reviewed = 0
value = excluded.value,
context = excluded.context,
updated_at = excluded.updated_at,
is_reviewed = 0
""",
(translation_id, key, language, value, namespace, context, now, now),
)
@@ -1186,11 +1191,15 @@ class LocalizationManager:
cursor.execute(
"""
INSERT INTO tenant_data_center_mappings
(id, tenant_id, primary_dc_id, secondary_dc_id, region_code, data_residency, created_at, updated_at)
(id, tenant_id, primary_dc_id, secondary_dc_id, region_code,
data_residency, created_at, updated_at)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
ON CONFLICT(tenant_id) DO UPDATE SET
primary_dc_id = excluded.primary_dc_id, secondary_dc_id = excluded.secondary_dc_id,
region_code = excluded.region_code, data_residency = excluded.data_residency, updated_at = excluded.updated_at
primary_dc_id = excluded.primary_dc_id,
secondary_dc_id = excluded.secondary_dc_id,
region_code = excluded.region_code,
data_residency = excluded.data_residency,
updated_at = excluded.updated_at
""",
(
mapping_id,