-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
More flexible plugin API that allows to process entire message #577
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good.
Lars Kotthoff writes on October 17, 2018 6:11:
See #571. These changes add a plugin API that passes the file name of the message to the `do_process` method of the plugin and expects a GMimeStream back -- this allows for arbitrary preprocessing of the message, including headers.
Example use case: add plain text part to HTML-only messages so that they can be quoted better when replying.
Merged. Could you please add the method to the reference in the wiki?
|
Will do; I'll also add an example plugin. |
Lars Kotthoff writes on October 18, 2018 17:06:
Will do; I'll also add an example plugin.
Great! I think we can close the original issue?
|
I've added a short description to the wiki and put an example plugin at https://github.com/larskotthoff/astroid-processing-plugin. Could you add that to the plugins repo please? |
Lars Kotthoff writes on October 18, 2018 17:58:
I've added a short description to the wiki and put an example plugin at https://github.com/larskotthoff/astroid-processing-plugin. Could you add that to the plugins repo please?
Thanks, will do. It would be great if it also works on GMime 3. Would it
be a big hassle to change that? Some of the other plugins at least used
to import 3.0 if 2.6 failed (or maybe it was the other way).
|
I'm getting
when I change it to 3.0. Any ideas what's going on there? |
Lars Kotthoff writes on October 18, 2018 18:32:
I'm getting
gi.RepositoryError: Requiring namespace 'GMime' version '3.0', but '2.6' is already loaded
when I change it to 3.0. Any ideas what's going on there?
Hm, weird.. do you have any other plugins running? Maybe they are run in
the same python instance.
|
No other plugins. At least I'm not running anything explicitly; maybe astroid is loading a plugin that ships with it implicitly? |
Lars Kotthoff writes on October 18, 2018 18:38:
No other plugins. At least I'm not running anything explicitly; maybe astroid is loading a plugin that ships with it implicitly?
There are currently no plugins shipped with astroid.
|
See #571. These changes add a plugin API that passes the file name of the message to the
do_process
method of the plugin and expects a GMimeStream back -- this allows for arbitrary preprocessing of the message, including headers.Example use case: add plain text part to HTML-only messages so that they can be quoted better when replying.