mirror of
https://github.com/majmongoose/PageBot.git
synced 2026-10-10 09:12:49 -04:00
Update pagebot.py
This commit is contained in:
+12
@@ -189,10 +189,22 @@ def kill_process_tree(pid):
|
||||
except Exception as e:
|
||||
print(f"Error killing process tree: {e}")
|
||||
|
||||
def clean_ttd_temp():
|
||||
import glob
|
||||
import tempfile
|
||||
temp_dir = tempfile.gettempdir()
|
||||
for entry in glob.glob(os.path.join(temp_dir, '_MEI*')):
|
||||
try:
|
||||
shutil.rmtree(entry)
|
||||
print(f"Cleaned TTD temp: {entry}")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def launch_and_watch(program_path):
|
||||
global last_file_time
|
||||
program_directory = os.path.dirname(program_path)
|
||||
while True:
|
||||
clean_ttd_temp()
|
||||
last_file_time = time.time()
|
||||
process = subprocess.Popen(program_path, cwd=program_directory)
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user