Files
cursor-free-vip-main/enable_tool_update_check.py
2026-01-26 11:49:22 +01:00

46 lines
1.5 KiB
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
"""
Script to re-enable the tool's update check.
"""
import os
import sys
from pathlib import Path
def enable_update_check():
"""Re-enable the update check by modifying the main.py"""
main_py_path = Path(__file__).parent / "main.py"
if not main_py_path.exists():
print("❌ main.py not found!")
return False
try:
# Read the current main.py content
with open(main_py_path, 'r', encoding='utf-8') as f:
content = f.read()
# Find the commented update check line and uncomment it
old_line = " # check_latest_version(translator) # Temporarily disabled to fix update loop"
new_line = " check_latest_version(translator)"
if old_line in content:
new_content = content.replace(old_line, new_line)
# Write the modified content back
with open(main_py_path, 'w', encoding='utf-8') as f:
f.write(new_content)
print("✅ Update check has been re-enabled!")
print(" The application will now check for updates automatically again.")
return True
else:
print("❌ Could not find the disabled update check line in main.py")
return False
except Exception as e:
print(f"❌ Error modifying main.py: {e}")
return False
if __name__ == "__main__":
enable_update_check()