Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r7ea06f6694a6c28c6c071cd8b7b8c75f72fb41ac -r043c2695cbc8e90cfe6ebde197300de94a80fbdb --- shared/scripts/configuration/utility.py (.../utility.py) (revision 7ea06f6694a6c28c6c071cd8b7b8c75f72fb41ac) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 043c2695cbc8e90cfe6ebde197300de94a80fbdb) @@ -12,29 +12,29 @@ # ############################################################################ -import glob -import test -import os from datetime import datetime -from datetime import date -from configuration import config - -def get_extracted_file_inp_buf(): + +def get_current_date_and_time(date_format='%Y/%b/%d - %H:%M:%S'): + + date = datetime.now() + return str(date.strftime(date_format)) + +def get_extracted_input_buf_file(): """ - This function is the handler for getting file from cloudsync folder. + This function is the handler for getting file from log folder. - This handler will go inside cloudsync folder and looks for newly added input buf file based on current time. - If it is satisfying that condition, it will return the exact path of newly created input buf file. + This handler will go inside log folder and looks for newly added log based on current time. + if it satisfied that condition, it will return the exact path of newly created log. - @return latest_file - (string) returns latest file that append on log folder from sd-data + Application log file is automatically created on '/home/denali/Desktop/sd-card/log/ {current_date}_denaliSquish.log' + + @return latest_file - (string) returns latest file that append on log folder from sd-data """ try: - list_of_files = glob.glob(config.CLOUD_SYNC_INP__BUF_LOCATION) - latest_file = max(list_of_files, key=os.path.getctime) - test.log(str(latest_file)) - return str(latest_file) + current_date = get_current_date_and_time(date_format = "%Y_%m_%d") + latest_file = '/home/denali/Desktop/sd-card/cloudsync/'+current_date+'_inp.buf' + return latest_file except: - test.fail("input buf file is not created during application interaction") - return False + return False