def get_site_data():
    data = {}
    for data_file in os.listdir(data_folder):
        if data_file.startswith('_'):
            continue
        if (not data_file.endswith('.yml')):
            continue
        data_file_path = path.join(data_folder, data_file)
        with open(data_file_path, encoding='UTF-8') as stream:
            try:
                file_name_without_extension = (data_file[:(- 4)] if data_file.endswith('.yml') else data_file)
                data[file_name_without_extension] = yaml.load(stream, Loader=FullLoader)
            except yaml.YAMLError as exc:
                sys.stderr.write((('Cant parse data file ' + data_file) + ': '))
                sys.stderr.write(str(exc))
                sys.exit((- 1))
            except IOError as exc:
                sys.stderr.write((('Cant read data file ' + data_file) + ': '))
                sys.stderr.write(str(exc))
                sys.exit((- 1))
    return data
def get_site_data():
    data = {}
    for data_file in os.listdir(data_folder):
        if data_file.startswith('_'):
            continue
        if (not data_file.endswith('.yml')):
            continue
        data_file_path = path.join(data_folder, data_file)
        with open(data_file_path, encoding='UTF-8') as stream:
            try:
                file_name_without_extension = (data_file[:(- 4)] if data_file.endswith('.yml') else data_file)
                data[file_name_without_extension] = yaml.load(stream, Loader=FullLoader)
            except yaml.YAMLError as exc:
                sys.stderr.write((('Cant parse data file ' + data_file) + ': '))
                sys.stderr.write(str(exc))
                sys.exit((- 1))
            except IOError as exc:
                sys.stderr.write((('Cant read data file ' + data_file) + ': '))
                sys.stderr.write(str(exc))
                sys.exit((- 1))
    return data