Skip to content

Commit

Permalink
supress line output for every image loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
P-Mousley committed Dec 11, 2024
1 parent 80eec52 commit 131a58c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CLI/process_xrr.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,17 @@
print(f'Slurm output file: {Path.home()}/islatu//{endslurms[-1]}\n')
breakerline='*'*35
monitoring_line=f"\n{breakerline}\n ***STARTING TO MONITOR TAIL END OF FILE, TO EXIT THIS VIEW PRESS ANY LETTER FOLLOWED BY ENTER**** \n{breakerline} \n"
print(monitoring_line)
process = subprocess.Popen(["tail","-f",f"{Path.home()}/islatu//{endslurms[-1]}"], stdout=subprocess.PIPE, text=True)
target_phrase="Reduced data stored"
try:
for line in process.stdout:
print(line.strip()) # Print each line of output
if "Loading images" in line:
print(line.strip(),'\n')
elif"Currently loaded" in line:
print(f"\r{line.strip()}", end='')
else:
print(line.strip()) # Print each line of output
if re.search(target_phrase, line):
print(f"Target phrase '{target_phrase}' found. Closing tail.")
break
Expand Down

0 comments on commit 131a58c

Please sign in to comment.