Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r40314c67874695eefc506c3a6a33896495953edd -r4800083679383c87221a7e55ad35f84b40ffb386 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 40314c67874695eefc506c3a6a33896495953edd) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 4800083679383c87221a7e55ad35f84b40ffb386) @@ -636,7 +636,7 @@ #TODO: dynamic name try: current_date = get_current_date_and_time(date_format = "%Y_%m_%d") - latest_file = config.LOG_LOCATION + current_date + '_denaliSquish.log' + latest_file = config.LOG_LOCATION + current_date + '_denali.log' return latest_file except: return False @@ -866,7 +866,7 @@ newFileName = filename oldFileName = filename + "_1" if os.path.exists(path+newFileName): - # During running of AUT, the application re-creates the folder (eg: application/resources/settings) + # During running of AUT, the application re-creates the folder (eg: unittests/resources/settings) # need to delete before renaming shutil.rmtree(path+newFileName) if os.path.exists(path+oldFileName): @@ -875,6 +875,15 @@ else: test.log(str(oldFileName+" failed to rename to "+newFileName)) +def remove_files_in_folder(folder_path): + if not os.path.exists(folder_path): + return + + for filename in os.listdir(folder_path): + file_path = os.path.join(folder_path, filename) + os.remove(file_path) + + def vitals_interval_obj(interval): names.o_time_interval_obj["text"] = interval return names.o_time_interval_obj @@ -915,7 +924,7 @@ @return latest_file - (string) returns latest file that append on log folder from sd-data """ try: - list_of_files = glob.glob(config.POST_TREATMENT_LOG_LOCATION) + list_of_files = glob.glob(config.POST_TREATMENT_LOG_FILTER) latest_file = max(list_of_files, key=os.path.getctime) return latest_file except: