Filtering plugins in plugin_manager #31
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Small PR related to the behavior of the plugin manager
Some preliminary comments
The way the filter is being used does not require at all RegExp syntax and I am not sure that we are interested in going in that direction. Overall, this complexifies the syntax for not much reason.
The filter checks all the information (name/description/instrument) to test if a plugin should be displayed in the list. This does not feel necessary as a standard behavior (in particular if the plugin's description are outdated.)

As a small example, by typing
thorlabsOne gets access to plugins not related to it. In fact, it is because the thorlabs word appear in a url in the description of the plugin (which is not seen by the user).
In fact, if one would type
thor, all the plugins would be accepted as you can findauthorsin all the plugins' description.What this PR does:
it simplifies the syntax by only testing str instead of using regexp making it less prone to error for standard use
it adds some QCheckBox to extend the filter settings, in general one would only need to filter by name which is now the standard use. With the example above, now we only see Thorlabs as expected.
Qt.DisplayRolebecomesQt.ItemDataRole.DisplayRolewith qtpy. In practice, this helps avoiding possible conflicts between different Qt version: