# -*- coding: utf-8 -*- """百度网盘备份配置。 上传先落到「我的应用数据/bypy/AIinfra_Cursor/」(bypy 应用目录), 再移动到网盘根下真正的 /AIinfra_Cursor/ 时间戳子目录。 """ import os from pathlib import Path import _bootstrap # noqa: F401 ROOT = Path(__file__).resolve().parents[2] # bypy staging 相对路径 → /apps/bypy/AIinfra_Cursor/ BAIDUPAN_FOLDER = os.environ.get("BAIDUPAN_FOLDER", "AIinfra_Cursor").strip().strip("/") # 终盘目录(网盘根下的真实目录)→ /AIinfra_Cursor/ BAIDUPAN_FINAL_ROOT = ( os.environ.get("BAIDUPAN_FINAL_ROOT") or "AIinfra_Cursor" ).strip().strip("/") # 上传后是否自动从「我的应用数据/bypy」挪到终盘(默认开启) BAIDUPAN_MOVE_AFTER_UPLOAD = os.environ.get("BAIDUPAN_MOVE_AFTER_UPLOAD", "1").strip().lower() not in ( "0", "false", "no", "off", ) BYPY_APP_ROOT = "/apps/bypy" BYPY_TOKEN_PATH = Path.home() / ".bypy" / "bypy.json" XPAN_FILE_API = "https://pan.baidu.com/rest/2.0/xpan/file" MANIFEST_PATH = ROOT / "patches_cursor" / "百度网盘备份" / "backup_manifest.json" STATE_DIR = ROOT / "data" / "baidu_backup" PROGRESS_FILE = STATE_DIR / "上传进度.txt" LAST_MANIFEST_FILE = STATE_DIR / "last_manifest.json" BYPY_UPLOAD_TIMEOUT_S = int(os.environ.get("BYPY_UPLOAD_TIMEOUT", "1200")) BYPY_UPLOAD_RETRIES = int(os.environ.get("BYPY_UPLOAD_RETRIES", "4"))