"""
This file handles all things configuration i.e even the parts of the configuration we are interested in
"""
import os
import json

def get (path) :
    if os.path.exists(path) :
        f = open(path) 
        _conf = json.loads(f.read())
        f.close()
    else:
        _conf = {}
    return _conf
def _isvalid(_allowed,**_args):
    
    if not list(set(_allowed) - set(_args.keys())) :
        _pargs = {}
        for key in _allowed :
            _pargs [key] = _args[key]
        return _pargs
    return False
 
def write(_config, path):
    f = open(path,'w')
    f.write( json.dumps(_config)) ;
    f.close()

