From 9c4836f8ab7aaae9b04bdb92a31538c0396dfb35 Mon Sep 17 00:00:00 2001 From: Penny How Date: Mon, 23 Sep 2024 13:53:59 -0100 Subject: [PATCH] modified flag added --- src/pypromice/tx/get_watsontx.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/pypromice/tx/get_watsontx.py b/src/pypromice/tx/get_watsontx.py index e5b74a27..ec216bc5 100644 --- a/src/pypromice/tx/get_watsontx.py +++ b/src/pypromice/tx/get_watsontx.py @@ -120,12 +120,15 @@ def get_watsontx(): # Sort L0tx files and add tails for f in glob(out_dir+'/*.txt'): - - # Sort lines in L0tx file and remove duplicates - in_dirn, in_fn = os.path.split(f) - out_fn = 'sorted_' + in_fn - out_pn = os.sep.join((in_dirn, out_fn)) - sortLines(f, out_pn) + + # Find modified files (within the last hour) + if isModified(f, 1): + + # Sort lines in L0tx file and remove duplicates + in_dirn, in_fn = os.path.split(f) + out_fn = 'sorted_' + in_fn + out_pn = os.sep.join((in_dirn, out_fn)) + sortLines(f, out_pn) # Close mail server if open if 'mail_server' in locals():