Uninstall plugins. Pass an instance to remove a specific plugin, a type object to remove all plugins that match that type, a string to remove all plugins with a matching ``name`` attribute or ``True`` to remove all plugins. Return the list of removed plugins.
(self, plugin)
| 812 | return plugin |
| 813 | |
| 814 | def uninstall(self, plugin): |
| 815 | """ Uninstall plugins. Pass an instance to remove a specific plugin, a type |
| 816 | object to remove all plugins that match that type, a string to remove |
| 817 | all plugins with a matching ``name`` attribute or ``True`` to remove all |
| 818 | plugins. Return the list of removed plugins. """ |
| 819 | removed, remove = [], plugin |
| 820 | for i, plugin in list(enumerate(self.plugins))[::-1]: |
| 821 | if remove is True or remove is plugin or remove is type(plugin) \ |
| 822 | or getattr(plugin, 'name', True) == remove: |
| 823 | removed.append(plugin) |
| 824 | del self.plugins[i] |
| 825 | if hasattr(plugin, 'close'): plugin.close() |
| 826 | if removed: self.reset() |
| 827 | return removed |
| 828 | |
| 829 | def reset(self, route=None): |
| 830 | """ Reset all routes (force plugins to be re-applied) and clear all |