summaryrefslogtreecommitdiff
path: root/poezio/plugin_manager.py
AgeCommit message (Collapse)Author
2020-02-17plugins: Allow entry_points to be registeredMaxime “pep” Buquet
It's currently impractical to use out-of-tree plugins that want to be distributed via distribution channels. Poezio now looks for every entry point registered in the `poezio_plugins` entry group, and will use the first matching module with the specified name. This also helps specifically for the OMEMO plugin that has a conflicting name (omemo / omemo) with the backend library. Thanks jonas for pointing this out. Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-12-27Plugins: use import_module for module in poezio_pluginsmathieui
And do not rely on the "module name" to index the plugins, use the intended plugin name instead.
2019-06-22Rework priority handling for eventsMaxime “pep” Buquet
Introduce the concept of priority for event handlers, instead of the position parameter. The new `priority` parameter replacing `position` should be an integer between 0 and 100. It defaults to 50. The previous `position` parameter was only used to insert at a certain position in the list of handlers (for this particular event). No reference of it was kept, which means that it was not possible to ensure an event was called in the position is was supposed to be. I am now using per-event dicts, containing priority buckets (lists) of handlers. I am using OrderedDicts to make it easier to loop through all of the handlers, as insertion happens less often than reading. I was also suggested using bisect with a simple list of tuples (priority, handler) per event, but bisect tries to compare bound methods, which is obviously not possible. Maybe it would be interesting to find a way use this method instead of OrderedDict as that might be less resource consuming. This said, I don't think this part of poezio is a bottleneck at all, so maybe this is just fine as is. Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2018-07-21yapf -ripmathieui
2018-07-14Stop making classes inherit from object.Emmanuel Gil Peyrot
2018-07-05Add a few more str() on pathlib.Path objects.Emmanuel Gil Peyrot
2018-07-04Simplify plugins path changes.Emmanuel Gil Peyrot
2018-07-04plugin_manager: Add back forgotten self.Emmanuel Gil Peyrot
2018-07-04Move XDG basedir functions to the poezio.xdg module.Emmanuel Gil Peyrot
2018-07-03Use the new config.get_default_config_dir() in plugin_manager.Emmanuel Gil Peyrot
2018-01-16yapf -ripmathieui
2018-01-13yapf -irmathieui
2017-11-12yapf -irmathieui
2017-10-13Improve some bare or redundant exceptsmathieui
2017-10-12Fix some excepts (bare, useless, unused)mathieui
2017-10-08Change all “not … in …” into “… not in …”.Emmanuel Gil Peyrot
2016-12-26Add missing message types (fix #3271)mathieui
Which were being filtered by the information popup filter
2016-10-21pyflake fixesmathieui
unused variables, imports, name shadowing
2016-08-21Don’t call input completion() functions inside completion methodsmathieui
Use a placeholder object that can run it afterwards, so that we don’t have side effects inside those functions.
2016-07-03Fix plugin loading when installedmathieui
2016-06-30Only import "Command" instead of "core" when possiblemathieui
2016-06-30Absolute imports everywheremathieui
2016-06-27Make all relative imports explicit.Emmanuel Gil Peyrot
2016-06-12Convert some genexprs into regular list comprehension.Emmanuel Gil Peyrot
2016-06-11Move the src directory to poezio, for better cython compatibility.Emmanuel Gil Peyrot