new plugin event: library_opened

This commit is contained in:
Adrian Sampson 2012-05-15 12:39:04 -07:00
parent c9da7bf3f8
commit dfcd47942d
3 changed files with 6 additions and 0 deletions

View file

@ -731,6 +731,7 @@ def main(args=None, configfh=None):
replacements)
except sqlite3.OperationalError:
raise UserError("database file %s could not be opened" % db_path)
plugins.send("library_opened", lib=lib)
# Configure the logger.
log = logging.getLogger('beets')

View file

@ -6,6 +6,8 @@ Changelog
* New plugin event: ``import_task_choice`` is called after an import task has an
action assigned.
* New plugin event: ``library_opened`` is called when beets starts up and
opens the library database.
1.0b14 (May 12, 2012)
---------------------

View file

@ -142,6 +142,9 @@ currently available are:
Use ``task.choice_flag`` to determine the action to be taken. Parameters:
``task`` and ``config``.
* *library_opened*: called after beets starts up and initializes the main
Library object. Parameter: ``lib``.
The included ``mpdupdate`` plugin provides an example use case for event listeners.
Extend the Autotagger