'commit'
This commit is contained in:
@@ -39,7 +39,17 @@ def mark_input_box():
|
||||
return
|
||||
|
||||
screenshot_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "Screenshots")
|
||||
if not os.path.exists(screenshot_dir):
|
||||
if os.path.exists(screenshot_dir):
|
||||
# 清空目录
|
||||
logger.info(f"正在清空截图目录: {screenshot_dir}")
|
||||
for f in os.listdir(screenshot_dir):
|
||||
file_path = os.path.join(screenshot_dir, f)
|
||||
try:
|
||||
if os.path.isfile(file_path):
|
||||
os.unlink(file_path)
|
||||
except Exception as e:
|
||||
logger.warning(f"删除文件失败 {file_path}: {e}")
|
||||
else:
|
||||
os.makedirs(screenshot_dir)
|
||||
|
||||
timestamp = time.strftime("%Y%m%d_%H%M%S")
|
||||
|
||||
Reference in New Issue
Block a user