30 lines
1.0 KiB
Python
30 lines
1.0 KiB
Python
|
|
with open('/tmp/edict/dashboard/server.py', 'r') as f:
|
|
content = f.read()
|
|
|
|
# 修改 initial_org
|
|
content = content.replace("initial_org = '太子'", "initial_org = '中书省'")
|
|
|
|
# 修改 state
|
|
content = content.replace("'state': 'Taizi',", "'state': 'Zhongshu',")
|
|
|
|
# 修改 now
|
|
content = content.replace("'now': '等待太子接旨分拣',", "'now': '等待中书省起草方案',")
|
|
|
|
# 修改 dispatch_for_state
|
|
content = content.replace("dispatch_for_state(task_id, new_task, 'Taizi', trigger='imperial-edict')",
|
|
"dispatch_for_state(task_id, new_task, 'Zhongshu', trigger='imperial-edict')")
|
|
|
|
# 修改 return message
|
|
content = content.replace("f'旨意 {task_id} 已下达,正在派发给太子'",
|
|
"f'旨意 {task_id} 已下达,正在派发给中书省(司马懿)'")
|
|
|
|
# 修改 official
|
|
content = content.replace("'official': official,", "'official': '中书令',")
|
|
|
|
with open('/tmp/edict/dashboard/server.py', 'w') as f:
|
|
f.write(content)
|
|
|
|
print("✅ 修改完成!")
|
|
|