Index: shared/scripts/configuration/utility.py =================================================================== diff -u -reefd61a5d338590b9ea89ef87d3a2c181e045cf5 -reb60fc7fabd81e5d61e9526dea36ceeecd29f1ea --- shared/scripts/configuration/utility.py (.../utility.py) (revision eefd61a5d338590b9ea89ef87d3a2c181e045cf5) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision eb60fc7fabd81e5d61e9526dea36ceeecd29f1ea) @@ -221,10 +221,25 @@ except: test.fail("Log file is not created or log file is not created based on standard log naming format.") +def get_extracted_file_inp_buf(): + """ + This function is the handler for getting file from log folder. + 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. -def get_current_log_details(message_ack = False, message_text = None): + @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) + return latest_file + except: + test.fail("input buf file is not created during application interaction") + return False + +def get_current_log_details_from_inp_buf(epoch, ZERO, registration_request, THREE, HD_VERSION_SERIAL, DG_VERSION_SERIAL = None, SW_VERSION): + """ This function is capable to perform data analysis from application log folder. logs are automatically created in path :"/home/denali/Desktop/sd-card/log/*.log". @@ -235,8 +250,8 @@ @return content_record - (list) list contains extracted data (ack_req, ack_bak, message, message_id). """ content_record = [] - file_name = get_extracted_file() - if message_text != None: + file_name = get_extracted_file_inp_buf() + if HD_VERSION_SERIAL= None: message = get_message_from_log(file_name, message_text) content_record.append(message) if message_ack != False: