mirror of
https://github.com/beetbox/beets.git
synced 2026-02-24 08:12:54 +01:00
For #1617: Use Confit's built-in path resolution
Has the side effect of raising more reasonable errors when the type is wrong.
This commit is contained in:
parent
fe1fab9aee
commit
9f1c113476
1 changed files with 5 additions and 7 deletions
|
|
@ -33,14 +33,12 @@ class IncludeLazyConfig(confit.LazyConfig):
|
|||
super(IncludeLazyConfig, self).read(user, defaults)
|
||||
|
||||
try:
|
||||
included_filenames = self['include'].get(list)
|
||||
for view in self['include'].all_contents():
|
||||
filename = view.as_filename()
|
||||
if os.path.isfile(filename):
|
||||
self.set_file(filename)
|
||||
except confit.NotFoundError:
|
||||
included_filenames = []
|
||||
|
||||
for filename in included_filenames:
|
||||
filename = os.path.join(self.config_dir(), filename)
|
||||
if os.path.isfile(filename):
|
||||
self.set_file(filename)
|
||||
pass
|
||||
|
||||
|
||||
config = IncludeLazyConfig('beets', __name__)
|
||||
|
|
|
|||
Loading…
Reference in a new issue