mirror of
https://github.com/beetbox/beets.git
synced 2025-12-08 01:23:09 +01:00
lastgenre: Add docstrings to file load methods
This commit is contained in:
parent
6da72beeb0
commit
6bc30eaf18
1 changed files with 9 additions and 0 deletions
|
|
@ -115,6 +115,10 @@ class LastGenrePlugin(plugins.BeetsPlugin):
|
||||||
self.c14n_branches, self.canonicalize = self._load_c14n_tree()
|
self.c14n_branches, self.canonicalize = self._load_c14n_tree()
|
||||||
|
|
||||||
def _load_whitelist(self) -> set[str]:
|
def _load_whitelist(self) -> set[str]:
|
||||||
|
"""Load the whitelist from a text file.
|
||||||
|
|
||||||
|
Default whitelist is used if config is True or empty string.
|
||||||
|
"""
|
||||||
whitelist = set()
|
whitelist = set()
|
||||||
wl_filename = self.config["whitelist"].get()
|
wl_filename = self.config["whitelist"].get()
|
||||||
if wl_filename in (True, ""): # Indicates the default whitelist.
|
if wl_filename in (True, ""): # Indicates the default whitelist.
|
||||||
|
|
@ -128,6 +132,11 @@ class LastGenrePlugin(plugins.BeetsPlugin):
|
||||||
return whitelist
|
return whitelist
|
||||||
|
|
||||||
def _load_c14n_tree(self) -> tuple[list[list[str]], bool]:
|
def _load_c14n_tree(self) -> tuple[list[list[str]], bool]:
|
||||||
|
"""Load the canonicalization tree from a YAML file.
|
||||||
|
|
||||||
|
Default tree is used if config is True or empty string, or if
|
||||||
|
prefer_specific is enabled.
|
||||||
|
"""
|
||||||
c14n_branches: list[list[str]] = []
|
c14n_branches: list[list[str]] = []
|
||||||
c14n_filename = self.config["canonical"].get()
|
c14n_filename = self.config["canonical"].get()
|
||||||
canonicalize = c14n_filename is not False
|
canonicalize = c14n_filename is not False
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue