Skip to content

Commit

Permalink
Get notmuch database path using Database wrapper
Browse files Browse the repository at this point in the history
It fixes afewmail#303 and closes afewmail#267, allowing FolderNameFilter to work with
relative path in database.path of notmuch config file.
  • Loading branch information
aya authored and GuillaumeSeren committed Sep 13, 2022
1 parent 295129d commit bc6ec88
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions afew/filters/FolderNameFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Copyright (c) dtk <dtk@gmx.de>

from afew.filters.BaseFilter import Filter
from afew.NotmuchSettings import notmuch_settings
import re
import shlex

Expand All @@ -15,7 +14,7 @@ def __init__(self, database, folder_blacklist='', folder_transforms='',
super().__init__(database)

self.__filename_pattern = '{mail_root}/(?P<maildirs>.*)/(cur|new)/[^/]+'.format(
mail_root=notmuch_settings.get('database', 'path').rstrip('/'))
mail_root=database.db_path.rstrip('/'))
self.__folder_explicit_list = set(shlex.split(folder_explicit_list))
self.__folder_blacklist = set(shlex.split(folder_blacklist))
self.__folder_transforms = self.__parse_transforms(folder_transforms)
Expand Down

0 comments on commit bc6ec88

Please sign in to comment.