mirror of
https://github.com/beetbox/beets.git
synced 2026-01-14 20:24:36 +01:00
simplify materialization in LazyConfig
This commit is contained in:
parent
42624eb745
commit
4d62a83210
2 changed files with 5 additions and 2 deletions
|
|
@ -689,9 +689,13 @@ class LazyConfig(Configuration):
|
|||
self._lazy_prefix = [] # Pre-materialization calls to set().
|
||||
self._lazy_suffix = [] # Calls to add().
|
||||
|
||||
def read(self, user=True, defaults=True):
|
||||
self._materialized = True
|
||||
super(LazyConfig, self).read(user, defaults)
|
||||
|
||||
def resolve(self):
|
||||
if not self._materialized:
|
||||
self._materialized = True
|
||||
# Read files and unspool buffers.
|
||||
self.read()
|
||||
self.sources += self._lazy_suffix
|
||||
self.sources[:0] = self._lazy_prefix
|
||||
|
|
|
|||
|
|
@ -92,7 +92,6 @@ class TestCase(unittest.TestCase):
|
|||
def setUp(self):
|
||||
# A "clean" source list including only the defaults.
|
||||
beets.config.sources = []
|
||||
beets.config._materialized = True
|
||||
beets.config.read(user=False, defaults=True)
|
||||
|
||||
# Direct paths to a temporary directory. Tests can also use this
|
||||
|
|
|
|||
Loading…
Reference in a new issue