X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=cnotmuch%2Fdatabase.py;h=b4411ab1ee71ff87c265b471ec8e1b0ffa3a6fd3;hp=8762f393467c7b89030c6ef75efd3b1e6d1b3e91;hb=b00c892c65ee57d6503b4bafe8fd666a6a274e47;hpb=65061756489566f134b6aeec7ef51cb6164be088 diff --git a/cnotmuch/database.py b/cnotmuch/database.py index 8762f393..b4411ab1 100644 --- a/cnotmuch/database.py +++ b/cnotmuch/database.py @@ -1,6 +1,6 @@ import ctypes from ctypes import c_int, c_char_p, c_void_p, c_uint64 -from cnotmuch.globals import nmlib, STATUS, NotmuchError +from cnotmuch.globals import nmlib, STATUS, NotmuchError, Enum import logging from datetime import date @@ -10,9 +10,8 @@ class Database(object): Do note that as soon as we tear down this object, all derived queries, threads, and messages will be freed as well. """ - #constants - MODE_READ_ONLY = 0 - MODE_READ_WRITE = 1 + MODE = Enum(['READ_ONLY','READ_WRITE']) + """Constants: Mode in which to open the database""" _std_db_path = None """Class attribute of users default database"""