browser-use-oauth/lib/utils/progress_checker.py
2025-06-27 10:18:24 +09:00

21 lines
No EOL
603 B
Python

import json
import os
from pathlib import Path
progress_file = Path("data/scan_progress.json")
def save_progress(current_progress):
"""현재 진행 상황을 파일에 저장"""
with open(progress_file, 'w', encoding='utf-8') as f:
json.dump(current_progress, f, ensure_ascii=False, indent=2)
def load_progress():
"""이전 진행 상황을 파일에서 불러오기"""
if os.path.exists(progress_file):
try:
with open(progress_file, 'r', encoding='utf-8') as f:
return json.load(f)
except:
return None
return None