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

Improve MeFilter #271

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
MeFilter: generalize init function
Instead of accepting only tags_blacklist just pass everything but
me_tags to the super class's init function. This way the message can be
overwritten in the config which up to now yields an exception:

	TypeError: __init__() got an unexpected keyword argument 'message'
ukleinek committed May 27, 2020
commit c6b3da534486265108816c00769a7d00156e7b96
4 changes: 2 additions & 2 deletions afew/filters/MeFilter.py
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@ class MeFilter(Filter):
message = 'Tagging all mails sent directly to myself'
_bare_email_re = re.compile(r"[^<]*<(?P<email>[^@<>]+@[^@<>]+)>")

def __init__(self, database, me_tag=None, tags_blacklist=[]):
super().__init__(database, tags_blacklist=tags_blacklist)
def __init__(self, database, me_tag=None, **kwargs):
super().__init__(database, **kwargs)

my_addresses = set()
my_addresses.add(notmuch_settings.get('user', 'primary_email'))