This commit is contained in:
Mayeul Aubin 2025-03-05 17:47:28 +01:00
parent d7890ef2b4
commit 3dc03cec4f
4 changed files with 146 additions and 6 deletions

View file

@ -182,4 +182,19 @@ def print_ending_module(module:str, verbose:int=1):
Print the ending message of a module.
"""
if verbose >= 1:
print(print_level(0, module)+f"Ending {module} module.")
print(print_level(0, module)+f"Ending {module} module.")
def wait_until_file_exists(filename:str, verbose:int=1, limit:int=24*3600):
"""
Wait until a file exists.
"""
from time import sleep
from os.path import isfile
k=0
while not isfile(filename):
if k%60 == -1:
print_message(f"Waiting for {filename} to exist. {k//60} minutes elapsed.", 3, "low level", verbose=verbose)
sleep(1)
print_message(f"File {filename} exists. {k//60} minutes elapsed.", 3, "low level", verbose=verbose)