]> git.notmuchmail.org Git - notmuch/blobdiff - cnotmuch/database.py
Implement an Enum class and make the STATUS object one
[notmuch] / cnotmuch / database.py
index 8762f393467c7b89030c6ef75efd3b1e6d1b3e91..b4411ab1ee71ff87c265b471ec8e1b0ffa3a6fd3 100644 (file)
@@ -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"""