Index: shared/scripts/configuration/config.py =================================================================== diff -u -rd4131d90694090a1cce9d3156dd1dbd402ae1b8d -rcd5dc8c84ddb7172c22c7dfa186d8926da9f2f7e --- shared/scripts/configuration/config.py (.../config.py) (revision d4131d90694090a1cce9d3156dd1dbd402ae1b8d) +++ shared/scripts/configuration/config.py (.../config.py) (revision cd5dc8c84ddb7172c22c7dfa186d8926da9f2f7e) @@ -14,11 +14,18 @@ ############################################################################ import os +from pathlib import Path AUT_NAME = "denaliSquish" -COMMON_PATH = os.environ['HOME']+"/Projects" +CONFIG_PATH = Path(os.getcwd()) +HOME_DIR_PATH = CONFIG_PATH.parent.parent.parent +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' ] + COLOR_CODES = {"Aqua": "#81ffff", "Blue": "#017dea", "Blue 2": "#1090d5", "Green": "#29fd2d", "Grey": "#d3d3d3", "Lavender": "#db98f5", "Light Blue": "#acd7f1", "Light Teal": "#29f1da","Lime": "#b7fc36", "Magenta":"#fd28fd", "Orange": "#f2721c", "Peach":"#f1979a", "Red": "#c53b33", "Rose":"#fc178d", Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r693e05b81eb1416f2a958d64f387f55c73bacc65 -rcd5dc8c84ddb7172c22c7dfa186d8926da9f2f7e --- shared/scripts/configuration/utility.py (.../utility.py) (revision 693e05b81eb1416f2a958d64f387f55c73bacc65) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision cd5dc8c84ddb7172c22c7dfa186d8926da9f2f7e) @@ -15,15 +15,11 @@ import os import csv import test +from configuration import config from datetime import timezone from datetime import datetime - -CLOUD_CREDENTIALS_LOCATION = '/home/denali/Desktop/cloudsync/credentials' -CLOUD_SYNC_LOG_LOCATION = '/home/denali/Desktop/sd-card/cloudsync/' -PEM_FILES = ['1.pem', '2.pem', '3.pem' ] - def get_current_date_and_time_in_utc(date_format='%Y/%m/%d - %H:%M:%S'): """ Method to get current date and time. @@ -40,10 +36,10 @@ @return latest_file - (string) returns latest file that append on log folder from sd-data """ 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 @@ -58,7 +54,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: return False @@ -100,5 +96,4 @@ if expected_epoch_value > minimum_epoch_value and expected_epoch_value < maximum_epoch_value : return True - return False - + return False \ No newline at end of file