Fix docs on plugin prompt choices conflict solving

* Fix docstring and `plugins.rst` regarding how the PromptChoices that
use the same short letter are handled (they are discarded instead of
raising an Exception).
This commit is contained in:
Diego Moreda 2016-01-28 13:01:44 +01:00
parent db7fffbdcc
commit b7a2a42d9c
2 changed files with 8 additions and 5 deletions

View file

@ -853,7 +853,9 @@ class TerminalImportSession(importer.ImportSession):
checking the right conditions and returning a list of `PromptChoice`s,
which is flattened and checked for conflicts.
Raises `ValueError` if two of the choices have the same short letter.
If two or more choices have the same short letter, a warning is
emitted and all but one choices are discarded, giving preference
to the default importer choices.
Returns a list of `PromptChoice`s.
"""

View file

@ -585,10 +585,11 @@ album has no candidates, the relevant checks against ``task.candidates`` should
be performed inside the plugin's ``before_choose_candidate_event`` accordingly.
Please make sure that the short letter for each of the choices provided by the
plugin is not already in use: the importer will raise an exception if two or
more choices try to use the same short letter. As a reference, the following
characters are used by the choices on the core importer prompt, and hence
should not be used: ``a``, ``s``, ``u``, ``t``, ``g``, ``e``, ``i``, ``b``.
plugin is not already in use: the importer will emit a warning and discard
all but one of the choices using the same letter, giving priority to the
core importer prompt choices. As a reference, the following characters are used
by the choices on the core importer prompt, and hence should not be used:
``a``, ``s``, ``u``, ``t``, ``g``, ``e``, ``i``, ``b``.
Additionally, the callback function can optionally specify the next action to
be performed by returning one of the values from ``importer.action``, which