refactor morituri.common.directory to shed Directory() and bulk

This commit is contained in:
Samantha Baldwin
2016-11-02 17:52:14 -04:00
parent 1e0176553b
commit bccba71b42
6 changed files with 32 additions and 70 deletions

View File

@@ -155,17 +155,9 @@ class PersistedCache(log.Loggable):
class ResultCache(log.Loggable):
def __init__(self, path=None):
if not path:
path = self._getResultCachePath()
self._path = path
self._path = path or directory.cache_path('result')
self._pcache = PersistedCache(self._path)
def _getResultCachePath(self):
d = directory.Directory()
path = d.getCache('result')
return path
def getRipResult(self, cddbdiscid, create=True):
"""
Retrieve the persistable RipResult either from our cache (from a
@@ -208,8 +200,7 @@ class TableCache(log.Loggable):
def __init__(self, path=None):
if not path:
d = directory.Directory()
self._path = d.getCache('table')
self._path = directory.cache_path('table')
else:
self._path = path