From a7fed5b2c40b2cdb59db9e286c8aa493744422d6 Mon Sep 17 00:00:00 2001 From: "nathdwek@laptop" Date: Sun, 30 Oct 2016 17:21:32 +0100 Subject: [PATCH] plugins: document notify_info_yielded --- beets/plugins.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/beets/plugins.py b/beets/plugins.py index aa6b74393..3ea15f248 100644 --- a/beets/plugins.py +++ b/beets/plugins.py @@ -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):