'Gets all settings from the config file.
Required parameters:
None
Optional parameters:
key (str):      Name of a config section to return
Returns:
json:
{"General": {"api_enabled": true, ...}
"Advanced": {"cache_sizemb": "32", ...},'

def get_settings(self, key=''):

    interface_dir = os.path.join(plexpy.PROG_DIR, 'data/interfaces/')
    interface_list = [name for name in os.listdir(interface_dir) if os.path.isdir(os.path.join(interface_dir, name))]
    conf = plexpy.CONFIG._config
    config = {}
    for (k, v) in conf.iteritems():
        if isinstance(v, dict):
            d = {}
            for (kk, vv) in v.iteritems():
                if ((vv == '0') or (vv == '1')):
                    d[kk] = bool(vv)
                else:
                    d[kk] = vv
            config[k] = d
        if (k == 'General'):
            config[k]['interface'] = interface_dir
            config[k]['interface_list'] = interface_list
    if key:
        return config.get(key)
    return config
