From 4d62a832104f554d9106f0f555c95d4735e13228 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Fri, 17 May 2013 19:10:44 -0700 Subject: [PATCH] simplify materialization in LazyConfig --- beets/util/confit.py | 6 +++++- test/_common.py | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/beets/util/confit.py b/beets/util/confit.py index 6a787ce3c..6499f146d 100644 --- a/beets/util/confit.py +++ b/beets/util/confit.py @@ -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 diff --git a/test/_common.py b/test/_common.py index 0a2f8595b..864813766 100644 --- a/test/_common.py +++ b/test/_common.py @@ -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