mirror of
https://github.com/beetbox/beets.git
synced 2026-01-03 14:32:55 +01:00
plugins: document notify_info_yielded
This commit is contained in:
parent
2b468c1872
commit
a7fed5b2c4
1 changed files with 6 additions and 0 deletions
|
|
@ -491,6 +491,12 @@ def sanitize_choices(choices, choices_all):
|
|||
|
||||
|
||||
def notify_info_yielded(event):
|
||||
"""Makes a generator send the event 'event' every time it yields.
|
||||
This decorator is supposed to decorate a generator, but any function
|
||||
returning an iterable should work.
|
||||
Each yielded value is passed to plugins using the 'info' parameter of
|
||||
'send'.
|
||||
"""
|
||||
def decorator(generator):
|
||||
def decorated(*args, **kwargs):
|
||||
for v in generator(*args, **kwargs):
|
||||
|
|
|
|||
Loading…
Reference in a new issue