Index: shared/scripts/configuration/utility.py =================================================================== diff -u -rdc93cd0aeabdc36b82101be86224cc31ce57b626 -r87fd0808455003298fc99abff6e61a1a9c68244a --- shared/scripts/configuration/utility.py (.../utility.py) (revision dc93cd0aeabdc36b82101be86224cc31ce57b626) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 87fd0808455003298fc99abff6e61a1a9c68244a) @@ -36,10 +36,6 @@ from datetime import datetime -CLOUD_CREDENTIALS_LOCATION = '/home/denali/Desktop/cloudsync/credentials' -CLOUD_SYNC_LOG_LOCATION = '/home/denali/Desktop/sd-card/cloudsync/' -LOG_LOCATION = "/home/denali/Desktop/sd-card/log/*.log" - def color_verification(exp_val = "Red", act_val = "#c53b33"): test.compare(config.COLOR_CODES[color_name],(act_val.color[name])) @@ -173,12 +169,6 @@ def vitals_reading_obj(reading): names.o_vitals_reading["text"] = reading return names.o_vitals_reading - - -def get_current_date_and_time(date_format='%Y/%b/%d - %H:%M'): - - date = datetime.now() - return str(date.strftime(date_format)) def enter_keypad_value(entry): @@ -980,12 +970,11 @@ This function is used for creating .pem files in the cloudsync folder. pem files is created on '/home/denali/Desktop/cloudsync/credentials' """ - PEM_FILES = ['1.pem', '2.pem', '3.pem' ] try: - os.makedirs(CLOUD_CREDENTIALS_LOCATION, exist_ok = True) + os.makedirs(config.CLOUD_CREDENTIALS_LOCATION, exist_ok = True) test.log("Directory created successfully") - for file_handler in range(len(PEM_FILES)): - path = os.path.join(CLOUD_CREDENTIALS_LOCATION, PEM_FILES[file_handler]) + for file_handler in range(len(config.PEM_FILES)): + path = os.path.join(config.CLOUD_CREDENTIALS_LOCATION, config.PEM_FILES[file_handler]) with open(path, 'w') as file_reader: pass except OSError: @@ -999,7 +988,7 @@ """ try: current_date = get_current_date_and_time_in_utc(date_format = "%Y_%m_%d") - latest_file = CLOUD_SYNC_LOG_LOCATION+current_date+'_inp.buf' + latest_file = config.INP_BUF_FILE_LOCATION+current_date+'_inp.buf' return latest_file except: @@ -1014,7 +1003,7 @@ """ try: current_date = get_current_date_and_time_in_utc(date_format = "%Y_%m_%d") - latest_file = CLOUD_SYNC_LOG_LOCATION+current_date+'_out.buf' + latest_file = config.INP_BUF_FILE_LOCATION+current_date+'_out.buf' return latest_file except: return False @@ -1040,7 +1029,7 @@ """ try: current_date = get_current_date_and_time_in_utc(date_format = "%Y_%m_%d") - latest_file = '/home/denali/Desktop/sd-card/cloudsync/'+current_date+'_inp.buf' + latest_file = config.INP_BUF_FILE_LOCATION + current_date + '_inp.buf' return latest_file except: return False