def __init__(self): """Initialize the class.""" cache_dir = os.path.join(os.environ['HOME'], '.local/share/lyvi') if not os.path.exists(cache_dir): os.makedirs(cache_dir) self.cache = plyr.Database(cache_dir) self.lock = Lock()
def __init__(self, **kwargs): if not HAS_PLYR: raise LookupError('Plyr could be imported, which is needed for lyrics') self._cache_failures = kwargs.pop('cache_failures', True) self.database = plyr.Database(get_cache_path(None)) Provider.__init__(self, **kwargs)