Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins are incompatible with 0.18.6 #20

Closed
AshesITR opened this issue Jan 6, 2023 · 8 comments
Closed

Plugins are incompatible with 0.18.6 #20

AshesITR opened this issue Jan 6, 2023 · 8 comments

Comments

@AshesITR
Copy link
Contributor

AshesITR commented Jan 6, 2023

I love the additional plugins provided in this repo, but unfortunately the most recent albert update broke all plugins.
Looking at the current official plugin repo, it seems the API has changed from plain functions to providing a QueryHandler class.

@roman-acumen
Copy link

I have the same problem, and if one example is provided I can lend a hand

@AshesITR
Copy link
Contributor Author

Here is a relevant diff from the official python plugin repo showcasing the refactoring:

albertlauncher/python@55d5f89#diff-0a0a34f67478d6f83b240328e7a9f3cbc9909f6c4e068b272f3b53f7a4364475

@bergercookie
Copy link
Owner

Hi guys,

Thanks for pointing it out.

I think I 'll have a first go at migrating at least one of the plugins + the cookiecutter template to the new version - possibly during next week. After that I'm more than happy to accept contributions for migrating the rest of the plugins.

@uztnus
Copy link
Contributor

uztnus commented Jan 14, 2023

You can also take a look at #21 for a fix examples

@someshkoli
Copy link

Hey @bergercookie, have you given it a shot yet ? Let us know if you need help 🙌

@AshesITR
Copy link
Contributor Author

AshesITR commented May 4, 2023

Here are some things I've learned from migrating emoji-picker and remmina:

  • Most __xxx__ variables can be renamed to a md_yyy equivalent.
  • __target__ is no md_* variable but instead returned by defaultTarget().
  • All Actions are what used to be a FuncAction and needs an id. UrlAction() and ClipAction() have corresponding helpers in albert that can be called from the actions lambda instead.
  • Most functions can be "moved" into the Plugin class as-is, replacing global variables by instance variables where necessary.
  • query.isTriggered no longer exists. Instead, always assume that the query is triggered.
  • handleQuery() must use query.add([...]) instead of returning a list of Items.

@bergercookie
Copy link
Owner

FYI, just merged some PRs from @AshesITR and @uztnus . 5/34 plugins so far have been migrated :)

@bergercookie
Copy link
Owner

All plugins have now been migrated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants