Skip to content

Commit 0243a4a

Browse files
committed
lastgenre: Polish blacklist docstrings
1 parent c7217af commit 0243a4a

1 file changed

Lines changed: 15 additions & 16 deletions

File tree

beetsplug/lastgenre/__init__.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,19 @@ def _load_blacklist(self):
164164
- Subsequent lines are indented (at least one space, typically 4 spaces) and
165165
contain a regex pattern to match a genre.
166166
167-
Eg.:
168-
artist name 1:
169-
genre pattern 1
170-
genre pattern 2
171-
artist name 2:
172-
genre pattern 3
167+
168+
Supports a special '*' key in the blacklist for
169+
global forbidden genres.
170+
171+
Example blacklist file format:
172+
Artist Name:
173+
pop
174+
rock
175+
Another Artist Name:
176+
jazz
177+
*:
178+
spoken word
179+
comedy
173180
174181
Raises:
175182
UserError: if the file format is invalid.
@@ -350,17 +357,9 @@ def _is_valid(self, genre: str) -> bool:
350357
return False
351358

352359
def _is_forbidden(self, genre: str, artist: str) -> bool:
353-
"""Return True if the genre is forbidden for the artist.
360+
"""Return True if the genre is on the blacklist for the artist.
354361
355-
Supports a special '*' key in the blacklist for
356-
global forbidden genres.
357-
358-
Example blacklist file format:
359-
Artist Name:
360-
pop
361-
rock
362-
*:
363-
spoken word
362+
See `_load_blacklist` docstring for the blacklist file format.
364363
"""
365364
if not self.blacklist:
366365
return False

0 commit comments

Comments
 (0)