@classmethod
def for_config(cls, config):
    cachedir = cls.cache_dir_from_config(config)
    if (config.getoption('cacheclear') and cachedir.exists()):
        shutil.rmtree(str(cachedir))
        cachedir.mkdir()
    return cls(cachedir, config)
@classmethod
def for_config(cls, config):
    cachedir = cls.cache_dir_from_config(config)
    if (config.getoption('cacheclear') and cachedir.exists()):
        shutil.rmtree(str(cachedir))
        cachedir.mkdir()
    return cls(cachedir, config)