'Create a Config() object from the python file located at path.'

@classmethod
def from_file(cls, path):

    try:
        sys.path.insert(0, os.path.dirname(path))
        config = __import__(os.path.basename(path)[:(-3)])
    except Exception:
        import traceback
        from .log_utils import logger
        logger.exception('Could    not    import    config    file    %r', path)
        tb = traceback.format_exc()
        raise ConfigError(tb)
    return cls(**vars(config))
