0.0.20
A new dynamic attribute, .one, was added to slots and slot selections; it contains a selection of exactly one plugin. Accessing it will raise an exception if there is more than one plugin in the slot or selection.
This feature is very similar to how things used to be done:
selection = some_slot[‘plugin_name’]
if not selection:
raise SomeError(‘I need some plugin, sorry.’)
if len(selection) > 1:
raise SomeError(‘I need only one plugin!’)
selection()Now, the complete equivalent of the code above would look like this:
some_slot[‘plugin_name’].one()