#!/usr/bin/env python

"""
Load the config file from yaml file
"""
import sys
import yaml
from lumberjack import timber

files = {}
CONFIG_FILE = 'config.yaml'
log = timber(__name__)

class Configure:
    """ Configure Class """
    def __init__(self,config_file):
        """ init """
        self.config_file = config_file
        self.config = ''

    def load_config(self):
        """ load configuration from yaml file """
        try:
            with open(self.config_file, 'r', encoding="utf-8") as cf:
                self.config = yaml.load(cf, Loader=yaml.FullLoader)
        except FileNotFoundError as fnf_err:
            print(f'{fnf_err}: {self.config_file}') # This cannot be log b/c we haven't validated the logger yet.
            print(f'Copy config.yaml.EXAMPLE to {self.config_file}, and update accordingly.') # This cannot be log b/c we haven't validated the logger yet.
            sys.exit()

        return self.config