mirror of
https://github.com/j93es/browser-use-oauth.git
synced 2026-06-04 09:11:53 +09:00
[Refactor] 리팩터링
This commit is contained in:
parent
65150b3514
commit
e93e64756c
6 changed files with 32 additions and 26 deletions
|
|
@ -4,27 +4,6 @@ from pathlib import Path
|
|||
|
||||
progress_file = Path("data/scan_progress.json")
|
||||
|
||||
class ProgressChecker:
|
||||
def __init__(self, filepath):
|
||||
self.filepath = filepath
|
||||
self.progress = self.load_progress()
|
||||
|
||||
def save(self):
|
||||
"""현재 진행 상황을 파일에 저장"""
|
||||
with open(self.filepath, 'w', encoding='utf-8') as f:
|
||||
json.dump(self.progress, f, ensure_ascii=False, indent=2)
|
||||
|
||||
def load(self):
|
||||
"""이전 진행 상황을 파일에서 불러오기"""
|
||||
if os.path.exists(self.filepath):
|
||||
try:
|
||||
with open(self.filepath, 'r', encoding='utf-8') as f:
|
||||
return json.load(f)
|
||||
except:
|
||||
return None
|
||||
return None
|
||||
|
||||
|
||||
def save_progress(current_progress):
|
||||
"""현재 진행 상황을 파일에 저장"""
|
||||
with open(progress_file, 'w', encoding='utf-8') as f:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue