'''
    Application Data functions
'''

import os

__APPFOLDER = os.path.expandvars(r'%LOCALAPPDATA%\Merelec\spr')
__CACHE = f'{__APPFOLDER}\cache'
__DATA = f'{__APPFOLDER}\data'
__CONFIG = f'{__APPFOLDER}\config'

APPDIRS = {
    'APPFOLDER': __APPFOLDER,
    'CACHE': __CACHE,
    'DATA': __DATA,
    'CONFIG': __CONFIG
}


def check_appdata_folders():
    [create_dir(v) for (k, v) in APPDIRS.items()]


def create_dir(directory):
    if not os.path.exists(directory):
        os.makedirs(directory)
