Index: shared/scripts/configuration/config.py =================================================================== diff -u -r3a76055c3243ac7b2820fa12b6da09e89d8f0eb4 -r87fd0808455003298fc99abff6e61a1a9c68244a --- shared/scripts/configuration/config.py (.../config.py) (revision 3a76055c3243ac7b2820fa12b6da09e89d8f0eb4) +++ shared/scripts/configuration/config.py (.../config.py) (revision 87fd0808455003298fc99abff6e61a1a9c68244a) @@ -20,13 +20,9 @@ CONFIG_PATH = Path(os.getcwd()) HOME_DIR_PATH = CONFIG_PATH.parent.parent.parent - TREATMENT_UNHIGHLIGHTED_COLOR = "#000000" TREATMENT_HIGHLIGHTED_COLOR = "#135088" -COMMON_PATH = os.environ['HOME']+"/Projects" - - #Service password loction SERVICE_CONF_LOCATION ="".join([str(HOME_DIR_PATH),'/Projects/application/resources/settings/Service.conf']) @@ -39,6 +35,13 @@ EXPECTED_IMAGE_LOCATION ="".join([str(HOME_DIR_PATH),'/Projects/application/resources/settings/Instructions/']) TREATMENT_LOG_LOCATION = "".join([str(HOME_DIR_PATH),'/Desktop/sd-card/treatment/*.log']) +#cloud_sync_verification +INP_BUF_FILE_LOCATION = "".join([str(HOME_DIR_PATH),'/Desktop/sd-card/cloudsync/']) +CLOUD_CREDENTIALS_LOCATION = "".join([str(HOME_DIR_PATH)+'/Desktop/cloudsync/credentials']) + +PEM_FILES = ['1.pem', '2.pem', '3.pem' ] + + #standby mode GOODMORNING_START_TIME_SEC = 0 GOODEVENING_START_TIME_SEC = 43200 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