PEP 8 (I'm bored): mail.notmuchmail

This commit is contained in:
enkore 2014-10-14 16:47:19 +02:00
parent 2346d82ed8
commit 3b3b716307

View File

@ -17,25 +17,23 @@ class Notmuch(Backend):
""" """
settings = ( settings = (
("db_path","Path to the directory of your notmuch database"), ("db_path", "Path to the directory of your notmuch database"),
) )
db_path = None; db_path = None
def init(self): def init(self):
if not self.db_path: if not self.db_path:
defaultConfigFilename= os.path.expanduser("~/.notmuch-config") defaultConfigFilename = os.path.expanduser("~/.notmuch-config")
config = configparser.RawConfigParser() config = configparser.RawConfigParser()
# read tries to read and returns successfully read filenames # read tries to read and returns successfully read filenames
successful = config.read( [ successful = config.read([
os.environ.get("NOTMUCH_CONFIG",defaultConfigFilename), os.environ.get("NOTMUCH_CONFIG", defaultConfigFilename),
defaultConfigFilename defaultConfigFilename
] ])
)
self.db_path = config.get("database","path") self.db_path = config.get("database", "path")
self.db = notmuch.Database(self.db_path) self.db = notmuch.Database(self.db_path)