Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r705e0873df7444eadfa85a3af24670b445b6c1c3 -r15cca0a5aa54862e11fa0d416a1d8ae1ade38e8a --- shared/scripts/configuration/utility.py (.../utility.py) (revision 705e0873df7444eadfa85a3af24670b445b6c1c3) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 15cca0a5aa54862e11fa0d416a1d8ae1ade38e8a) @@ -17,21 +17,20 @@ import csv def get_current_date_and_time(date_format='%Y/%b/%d - %H:%M:%S'): - """ - Method to get current date and time. - @input date_format (str) - format of date to be retrieved. - @return (str) - date in specified format. - """ + 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 handler will go inside cloudsync folder and looks for newly added input buf file based on current time. - if it satisfied that condition, it will return the exact path of newly created input buf file. - Application input buf file is automatically created in '/home/denali/Desktop/sd-card/cloudsync/ {current_date}_inp.buf' - @return latest_file - (string) returns latest file that append in cloudsync folder + This function is the handler for getting file from cloudsync folder. + + This handler will go inside cloudsync folder and looks for newly added input buf file based on current time. + if it satisfied that condition, it will return the exact path of newly created input buf file. + + Application input buf file is automatically created in '/home/denali/Desktop/sd-card/cloudsync/ {current_date}_inp.buf' + + @return latest_file - (string) returns latest file that append in cloudsync folder """ try: current_date = get_current_date_and_time(date_format = "%Y_%m_%d") @@ -63,18 +62,8 @@ except: test.fail("Log file is not created or log file is not created based on standard log naming format.") -def get_epoch_value_consistancy(current_epoch_value, expected_epoch_value): - """ - This function is verify consistancy of epoch value. - @input current_epoch_value (float) - current epoch time - @input expected_epoch_value (str) - epoch time from the cloud-sync log. - @return (bool) - True/False - """ - expected_epoch_value = int(expected_epoch_value) - maximum_epoch_value = int(current_epoch_value + 25) - minimum_epoch_value = int(current_epoch_value - 25) - - if expected_epoch_value > minimum_epoch_value and expected_epoch_value < maximum_epoch_value : - return True - return False - + + + + +