MartinThoma / flitz

Fast Location / Indexing / Traversal Zone. A file explorer / finder with a tkinter GUI.
MIT License
0 stars 0 forks source link

Allow adding elements to the context menu #1

Closed MartinThoma closed 5 months ago

MartinThoma commented 5 months ago

We would need

As is_actionable and action need to be callables, it's not a simple configuration. We could use entrypoints, similar to pytest:

import pkg_resources

entry_point_group = 'pytest11'

print(f"Plugins in {entry_point_group} entry point group:")
for entry_point in pkg_resources.iter_entry_points(group=entry_point_group):
    print(entry_point.name)

It would likely make sense to use an abstract class for the interface so that the entry point. This way we could have multiple types of plugins with the same interface, using isinstance.

Examples

pytest