new plugin event: import_task_choice

This commit is contained in:
Adrian Sampson 2012-05-15 12:33:57 -07:00
parent 7e82673982
commit c9da7bf3f8
3 changed files with 8 additions and 0 deletions

View file

@ -605,6 +605,7 @@ def user_query(config):
choice = config.choose_match_func(task, config)
task.set_choice(choice)
log_choice(config, task)
plugins.send('import_task_choice', task=task, config=config)
# As-tracks: transition to singleton workflow.
if choice is action.TRACKS:

View file

@ -4,6 +4,8 @@ Changelog
1.0b15 (in development)
-----------------------
* New plugin event: ``import_task_choice`` is called after an import task has an
action assigned.
1.0b14 (May 12, 2012)
---------------------

View file

@ -137,6 +137,11 @@ currently available are:
* *import_task_apply*: called after metadata changes have been applied in an
import task. Parameters: ``task`` and ``config``.
* *import_task_choice*: called after a decision has been made about an import
task. This event can be used to initiate further interaction with the user.
Use ``task.choice_flag`` to determine the action to be taken. Parameters:
``task`` and ``config``.
The included ``mpdupdate`` plugin provides an example use case for event listeners.
Extend the Autotagger