[PATCH 3/9] python: reorder the arguments of NotmuchError.__init__()
authorJustus Winter <4winter@informatik.uni-hamburg.de>
Mon, 26 Sep 2011 01:05:31 +0000 (03:05 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:29 +0000 (09:39 -0800)
0c/532b7948d27d551a7a419c603762aac07ae08a [new file with mode: 0644]

diff --git a/0c/532b7948d27d551a7a419c603762aac07ae08a b/0c/532b7948d27d551a7a419c603762aac07ae08a
new file mode 100644 (file)
index 0000000..72b7425
--- /dev/null
@@ -0,0 +1,717 @@
+Return-Path: <teythoon@jade-hamburg.de>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 06C8E431FD0\r
+       for <notmuch@notmuchmail.org>; Sun, 25 Sep 2011 18:06:49 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id fwAwBobxMFwv for <notmuch@notmuchmail.org>;\r
+       Sun, 25 Sep 2011 18:06:47 -0700 (PDT)\r
+Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68])\r
+       (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 1BD60431FB6\r
+       for <notmuch@notmuchmail.org>; Sun, 25 Sep 2011 18:06:47 -0700 (PDT)\r
+Received: from mail.jade-hamburg.de (unknown [85.183.11.228])\r
+       (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by mail.cryptobitch.de (Postfix) with ESMTPSA id E1699505B25\r
+       for <notmuch@notmuchmail.org>; Mon, 26 Sep 2011 03:06:45 +0200 (CEST)\r
+Received: by mail.jade-hamburg.de (Postfix, from userid 401)\r
+       id 59847DF2A1; Mon, 26 Sep 2011 03:06:45 +0200 (CEST)\r
+Received: from thinkbox.jade-hamburg.de (unknown [10.1.1.109])\r
+       (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
+       (No client certificate requested) (Authenticated sender: teythoon)\r
+       by mail.jade-hamburg.de (Postfix) with ESMTPSA id 5D6BDDF29F;\r
+       Mon, 26 Sep 2011 03:06:13 +0200 (CEST)\r
+Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.76)\r
+       (envelope-from <teythoon@thinkbox.jade-hamburg.de>)\r
+       id 1R7ze5-0007OI-2r; Mon, 26 Sep 2011 03:06:09 +0200\r
+From: Justus Winter <4winter@informatik.uni-hamburg.de>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 3/9] python: reorder the arguments of NotmuchError.__init__()\r
+Date: Mon, 26 Sep 2011 03:05:31 +0200\r
+Message-Id:\r
+ <1316999137-28257-3-git-send-email-4winter@informatik.uni-hamburg.de>\r
+X-Mailer: git-send-email 1.7.6.3\r
+In-Reply-To:\r
+ <1316999137-28257-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
+References:\r
+ <1316999137-28257-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
+X-Mailman-Approved-At: Mon, 26 Sep 2011 09:17:56 -0700\r
+Cc: Justus Winter <4winter@informatik.uni-hamburg.de>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 26 Sep 2011 01:06:49 -0000\r
+\r
+It is customary for subclasses of Exception to take a string as\r
+the first argument that describes the problem.\r
+\r
+Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>\r
+---\r
+ bindings/python/notmuch/database.py |   48 ++++++++++++++--------------\r
+ bindings/python/notmuch/filename.py |    4 +-\r
+ bindings/python/notmuch/globals.py  |    6 ++--\r
+ bindings/python/notmuch/message.py  |   58 +++++++++++++++++-----------------\r
+ bindings/python/notmuch/tag.py      |    4 +-\r
+ bindings/python/notmuch/thread.py   |   32 +++++++++---------\r
+ 6 files changed, 76 insertions(+), 76 deletions(-)\r
+\r
+diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py\r
+index a462789..e174f55 100644\r
+--- a/bindings/python/notmuch/database.py\r
++++ b/bindings/python/notmuch/database.py\r
+@@ -108,7 +108,7 @@ class Database(object):\r
+     def _verify_initialized_db(self):\r
+         """Raises a NotmuchError in case self._db is still None"""\r
+         if self._db is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+     def create(self, path):\r
+         """Creates a new notmuch database\r
+@@ -247,9 +247,9 @@ class Database(object):\r
+             # we got an absolute path\r
+             if not path.startswith(self.get_path()):\r
+                 # but its initial components are not equal to the db path\r
+-                raise NotmuchError(STATUS.FILE_ERROR,\r
+-                                   message="Database().get_directory() called "\r
+-                                           "with a wrong absolute path.")\r
++                raise NotmuchError(message="Database().get_directory() called "\r
++                                           "with a wrong absolute path.",\r
++                                   status=STATUS.FILE_ERROR)\r
+             abs_dirpath = path\r
+         else:\r
+             #we got a relative path, make it absolute\r
+@@ -319,7 +319,7 @@ class Database(object):\r
+                                                   byref(msg_p))\r
\r
+         if not status in [STATUS.SUCCESS, STATUS.DUPLICATE_MESSAGE_ID]:\r
+-            raise NotmuchError(status)\r
++            raise NotmuchError(status=status)\r
\r
+         #construct Message() and return\r
+         msg = Message(msg_p, self)\r
+@@ -398,7 +398,7 @@ class Database(object):\r
\r
+         tags_p = Database._get_all_tags(self._db)\r
+         if tags_p == None:\r
+-            raise NotmuchError(STATUS.NULL_POINTER)\r
++            raise NotmuchError(status=STATUS.NULL_POINTER)\r
+         return Tags(tags_p, self)\r
\r
+     def create_query(self, querystring):\r
+@@ -524,13 +524,13 @@ class Query(object):\r
+                         (too little memory)\r
+         """\r
+         if db.db_p is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         # create reference to parent db to keep it alive\r
+         self._db = db\r
+         # create query, return None if too little mem available\r
+         query_p = Query._create(db.db_p, _str(querystr))\r
+         if query_p is None:\r
+-            raise NotmuchError(STATUS.NULL_POINTER)\r
++            raise NotmuchError(status=STATUS.NULL_POINTER)\r
+         self._query = query_p\r
\r
+     def set_sort(self, sort):\r
+@@ -544,7 +544,7 @@ class Query(object):\r
+                     been initialized.\r
+         """\r
+         if self._query is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         self.sort = sort\r
+         nmlib.notmuch_query_set_sort(self._query, sort)\r
+@@ -570,12 +570,12 @@ class Query(object):\r
+                       * STATUS.NULL_POINTER if search_threads failed\r
+         """\r
+         if self._query is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         threads_p = Query._search_threads(self._query)\r
\r
+         if threads_p is None:\r
+-            raise NotmuchError(STATUS.NULL_POINTER)\r
++            raise NotmuchError(status=STATUS.NULL_POINTER)\r
\r
+         return Threads(threads_p, self)\r
\r
+@@ -593,12 +593,12 @@ class Query(object):\r
+                       * STATUS.NULL_POINTER if search_messages failed\r
+         """\r
+         if self._query is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         msgs_p = Query._search_messages(self._query)\r
\r
+         if msgs_p is None:\r
+-            raise NotmuchError(STATUS.NULL_POINTER)\r
++            raise NotmuchError(status=STATUS.NULL_POINTER)\r
\r
+         return Messages(msgs_p, self)\r
\r
+@@ -618,7 +618,7 @@ class Query(object):\r
+                       * STATUS.NOT_INITIALIZED if query is not inited\r
+         """\r
+         if self._query is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         return Query._count_messages(self._query)\r
\r
+@@ -659,9 +659,9 @@ class Directory(object):\r
+     _get_child_directories.restype = c_void_p\r
\r
+     def _verify_dir_initialized(self):\r
+-        """Raises a NotmuchError(STATUS.NOT_INITIALIZED) if dir_p is None"""\r
++        """Raises a NotmuchError(status=STATUS.NOT_INITIALIZED) if dir_p is None"""\r
+         if self._dir_p is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+     def __init__(self, path, dir_p, parent):\r
+         """\r
+@@ -713,7 +713,7 @@ class Directory(object):\r
+                         STATUS.NOT_INITIALIZED\r
+                           The directory has not been initialized\r
+         """\r
+-        #Raise a NotmuchError(STATUS.NOT_INITIALIZED) if the dir_p is None\r
++        #Raise a NotmuchError(status=STATUS.NOT_INITIALIZED) if the dir_p is None\r
+         self._verify_dir_initialized()\r
\r
+         #TODO: make sure, we convert the mtime parameter to a 'c_long'\r
+@@ -723,7 +723,7 @@ class Directory(object):\r
+         if status == STATUS.SUCCESS:\r
+             return\r
+         #fail with Exception otherwise\r
+-        raise NotmuchError(status)\r
++        raise NotmuchError(status=status)\r
\r
+     def get_mtime(self):\r
+         """Gets the mtime value of this directory in the database\r
+@@ -737,7 +737,7 @@ class Directory(object):\r
+                         STATUS.NOT_INITIALIZED\r
+                           The directory has not been initialized\r
+         """\r
+-        #Raise a NotmuchError(STATUS.NOT_INITIALIZED) if self.dir_p is None\r
++        #Raise a NotmuchError(status=STATUS.NOT_INITIALIZED) if self.dir_p is None\r
+         self._verify_dir_initialized()\r
\r
+         return Directory._get_mtime(self._dir_p)\r
+@@ -756,7 +756,7 @@ class Directory(object):\r
+         The returned filenames will be the basename-entries only (not\r
+         complete paths.\r
+         """\r
+-        #Raise a NotmuchError(STATUS.NOT_INITIALIZED) if self._dir_p is None\r
++        #Raise a NotmuchError(status=STATUS.NOT_INITIALIZED) if self._dir_p is None\r
+         self._verify_dir_initialized()\r
\r
+         files_p = Directory._get_child_files(self._dir_p)\r
+@@ -769,7 +769,7 @@ class Directory(object):\r
+         The returned filenames will be the basename-entries only (not\r
+         complete paths.\r
+         """\r
+-        #Raise a NotmuchError(STATUS.NOT_INITIALIZED) if self._dir_p is None\r
++        #Raise a NotmuchError(status=STATUS.NOT_INITIALIZED) if self._dir_p is None\r
+         self._verify_dir_initialized()\r
\r
+         files_p = Directory._get_child_directories(self._dir_p)\r
+@@ -815,7 +815,7 @@ class Filenames(object):\r
\r
+     def next(self):\r
+         if self._files_p is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         if not nmlib.notmuch_filenames_valid(self._files_p):\r
+             self._files_p = None\r
+@@ -834,11 +834,11 @@ class Filenames(object):\r
+                  #THIS FAILS\r
+                  files = Database().get_directory('').get_child_files()\r
+                  if len(files) > 0:              #this 'exhausts' msgs\r
+-                     # next line raises NotmuchError(STATUS.NOT_INITIALIZED)!!!\r
++                     # next line raises NotmuchError(status=STATUS.NOT_INITIALIZED)!!!\r
+                      for file in files: print file\r
+         """\r
+         if self._files_p is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         i = 0\r
+         while nmlib.notmuch_filenames_valid(self._files_p):\r
+diff --git a/bindings/python/notmuch/filename.py b/bindings/python/notmuch/filename.py\r
+index a16e717..c5dfd94 100644\r
+--- a/bindings/python/notmuch/filename.py\r
++++ b/bindings/python/notmuch/filename.py\r
+@@ -68,7 +68,7 @@ class Filenames(object):\r
+              once all derived objects are dead.\r
+         """\r
+         if files_p is None:\r
+-            raise NotmuchError(STATUS.NULL_POINTER)\r
++            raise NotmuchError(status=STATUS.NULL_POINTER)\r
\r
+         self._files = files_p\r
+         #save reference to parent object so we keep it alive\r
+@@ -80,7 +80,7 @@ class Filenames(object):\r
+         This is the main function that will usually be used by the\r
+         user."""\r
+         if self._files is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         if not nmlib.notmuch_filenames_valid(self._files):\r
+             self._files = None\r
+diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py\r
+index 779ba5f..dd0c858 100644\r
+--- a/bindings/python/notmuch/globals.py\r
++++ b/bindings/python/notmuch/globals.py\r
+@@ -89,10 +89,10 @@ STATUS.__name__ = 'STATUS'\r
\r
\r
+ class NotmuchError(Exception):\r
+-    def __init__(self, status=None, message=None):\r
+-        """Is initiated with a (notmuch.STATUS[,message=None])"""\r
+-        self.status = status\r
++    def __init__(self, message=None, status=None):\r
++        """Is initiated with a (message=None[,status=notmuch.STATUS])"""\r
+         self.message = message\r
++        self.status = status\r
\r
+     def __str__(self):\r
+         if self.message is not None:\r
+diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py\r
+index a48900c..5cc3175 100644\r
+--- a/bindings/python/notmuch/message.py\r
++++ b/bindings/python/notmuch/message.py\r
+@@ -115,7 +115,7 @@ class Messages(object):\r
+                the Python object.(?)\r
+         """\r
+         if msgs_p is None:\r
+-            raise NotmuchError(STATUS.NULL_POINTER)\r
++            raise NotmuchError(status=STATUS.NULL_POINTER)\r
\r
+         self._msgs = msgs_p\r
+         #store parent, so we keep them alive as long as self  is alive\r
+@@ -131,7 +131,7 @@ class Messages(object):\r
+           therefore will not allow further iterations.\r
+         """\r
+         if self._msgs is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         # collect all tags (returns NULL on error)\r
+         tags_p = Messages._collect_tags(self._msgs)\r
+@@ -139,7 +139,7 @@ class Messages(object):\r
+         self._msgs = None\r
\r
+         if tags_p == None:\r
+-            raise NotmuchError(STATUS.NULL_POINTER)\r
++            raise NotmuchError(status=STATUS.NULL_POINTER)\r
+         return Tags(tags_p, self)\r
\r
+     def __iter__(self):\r
+@@ -148,7 +148,7 @@ class Messages(object):\r
\r
+     def next(self):\r
+         if self._msgs is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         if not nmlib.notmuch_messages_valid(self._msgs):\r
+             self._msgs = None\r
+@@ -292,7 +292,7 @@ class Message(object):\r
+               objects are dead.\r
+         """\r
+         if msg_p is None:\r
+-            raise NotmuchError(STATUS.NULL_POINTER)\r
++            raise NotmuchError(status=STATUS.NULL_POINTER)\r
+         self._msg = msg_p\r
+         #keep reference to parent, so we keep it alive\r
+         self._parent = parent\r
+@@ -305,7 +305,7 @@ class Message(object):\r
+                     is not initialized.\r
+         """\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         return Message._get_message_id(self._msg)\r
\r
+     def get_thread_id(self):\r
+@@ -322,7 +322,7 @@ class Message(object):\r
+                     is not initialized.\r
+         """\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         return Message._get_thread_id(self._msg)\r
\r
+@@ -345,7 +345,7 @@ class Message(object):\r
+                     is not initialized.\r
+         """\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         msgs_p = Message._get_replies(self._msg)\r
\r
+@@ -367,7 +367,7 @@ class Message(object):\r
+                     is not initialized.\r
+         """\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         return Message._get_date(self._msg)\r
\r
+     def get_header(self, header):\r
+@@ -389,12 +389,12 @@ class Message(object):\r
+                     * STATUS.NULL_POINTER, if no header was found\r
+         """\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         #Returns NULL if any error occurs.\r
+         header = Message._get_header(self._msg, header)\r
+         if header == None:\r
+-            raise NotmuchError(STATUS.NULL_POINTER)\r
++            raise NotmuchError(status=STATUS.NULL_POINTER)\r
+         return header.decode('UTF-8')\r
\r
+     def get_filename(self):\r
+@@ -405,7 +405,7 @@ class Message(object):\r
+               is not initialized.\r
+         """\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         return Message._get_filename(self._msg)\r
\r
+     def get_filenames(self):\r
+@@ -415,7 +415,7 @@ class Message(object):\r
+         messages recorded to have the same Message-ID. These files must\r
+         not necessarily have identical content."""\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         files_p = Message._get_filenames(self._msg)\r
\r
+@@ -435,7 +435,7 @@ class Message(object):\r
+               is not initialized.\r
+         """\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         return Message._get_flag(self._msg, flag)\r
\r
+     def set_flag(self, flag, value):\r
+@@ -450,7 +450,7 @@ class Message(object):\r
+               is not initialized.\r
+         """\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         nmlib.notmuch_message_set_flag(self._msg, flag, value)\r
\r
+     def get_tags(self):\r
+@@ -464,11 +464,11 @@ class Message(object):\r
+                       * STATUS.NULL_POINTER, on error\r
+         """\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         tags_p = Message._get_tags(self._msg)\r
+         if tags_p == None:\r
+-            raise NotmuchError(STATUS.NULL_POINTER)\r
++            raise NotmuchError(status=STATUS.NULL_POINTER)\r
+         return Tags(tags_p, self)\r
\r
+     def add_tag(self, tag, sync_maildir_flags=False):\r
+@@ -503,13 +503,13 @@ class Message(object):\r
+                      The message has not been initialized.\r
+        """\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         status = nmlib.notmuch_message_add_tag(self._msg, _str(tag))\r
\r
+         # bail out on failure\r
+         if status != STATUS.SUCCESS:\r
+-            raise NotmuchError(status)\r
++            raise NotmuchError(status=status)\r
\r
+         if sync_maildir_flags:\r
+             self.tags_to_maildir_flags()\r
+@@ -547,12 +547,12 @@ class Message(object):\r
+                      The message has not been initialized.\r
+         """\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         status = nmlib.notmuch_message_remove_tag(self._msg, _str(tag))\r
+         # bail out on error\r
+         if status != STATUS.SUCCESS:\r
+-            raise NotmuchError(status)\r
++            raise NotmuchError(status=status)\r
\r
+         if sync_maildir_flags:\r
+             self.tags_to_maildir_flags()\r
+@@ -584,13 +584,13 @@ class Message(object):\r
+                      The message has not been initialized.\r
+         """\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         status = nmlib.notmuch_message_remove_all_tags(self._msg)\r
\r
+         # bail out on error\r
+         if status != STATUS.SUCCESS:\r
+-            raise NotmuchError(status)\r
++            raise NotmuchError(status=status)\r
\r
+         if sync_maildir_flags:\r
+             self.tags_to_maildir_flags()\r
+@@ -638,7 +638,7 @@ class Message(object):\r
+                      The message has not been initialized.\r
+         """\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         status = nmlib.notmuch_message_freeze(self._msg)\r
\r
+@@ -646,7 +646,7 @@ class Message(object):\r
+             # return on success\r
+             return status\r
\r
+-        raise NotmuchError(status)\r
++        raise NotmuchError(status=status)\r
\r
+     def thaw(self):\r
+         """Thaws the current 'message'\r
+@@ -673,7 +673,7 @@ class Message(object):\r
+                      The message has not been initialized.\r
+         """\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         status = nmlib.notmuch_message_thaw(self._msg)\r
\r
+@@ -681,7 +681,7 @@ class Message(object):\r
+             # return on success\r
+             return status\r
\r
+-        raise NotmuchError(status)\r
++        raise NotmuchError(status=status)\r
\r
+     def is_match(self):\r
+         """(Not implemented)"""\r
+@@ -709,7 +709,7 @@ class Message(object):\r
+         :returns: a :class:`STATUS`. In short, you want to see\r
+             notmuch.STATUS.SUCCESS here. See there for details."""\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         status = Message._tags_to_maildir_flags(self._msg)\r
\r
+     def maildir_flags_to_tags(self):\r
+@@ -736,7 +736,7 @@ class Message(object):\r
+         :returns: a :class:`STATUS`. In short, you want to see\r
+             notmuch.STATUS.SUCCESS here. See there for details."""\r
+         if self._msg is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         status = Message._tags_to_maildir_flags(self._msg)\r
\r
+     def __repr__(self):\r
+diff --git a/bindings/python/notmuch/tag.py b/bindings/python/notmuch/tag.py\r
+index 50e3686..9ca871a 100644\r
+--- a/bindings/python/notmuch/tag.py\r
++++ b/bindings/python/notmuch/tag.py\r
+@@ -70,7 +70,7 @@ class Tags(object):\r
+                cache the tags in the Python object(?)\r
+         """\r
+         if tags_p is None:\r
+-            raise NotmuchError(STATUS.NULL_POINTER)\r
++            raise NotmuchError(status=STATUS.NULL_POINTER)\r
\r
+         self._tags = tags_p\r
+         #save reference to parent object so we keep it alive\r
+@@ -82,7 +82,7 @@ class Tags(object):\r
\r
+     def next(self):\r
+         if self._tags is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         if not nmlib.notmuch_tags_valid(self._tags):\r
+             self._tags = None\r
+             raise StopIteration\r
+diff --git a/bindings/python/notmuch/thread.py b/bindings/python/notmuch/thread.py\r
+index 5e08eb3..93089d0 100644\r
+--- a/bindings/python/notmuch/thread.py\r
++++ b/bindings/python/notmuch/thread.py\r
+@@ -95,7 +95,7 @@ class Threads(object):\r
+                the Python object.(?)\r
+         """\r
+         if threads_p is None:\r
+-            raise NotmuchError(STATUS.NULL_POINTER)\r
++            raise NotmuchError(status=STATUS.NULL_POINTER)\r
\r
+         self._threads = threads_p\r
+         #store parent, so we keep them alive as long as self  is alive\r
+@@ -107,7 +107,7 @@ class Threads(object):\r
\r
+     def next(self):\r
+         if self._threads is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         if not nmlib.notmuch_threads_valid(self._threads):\r
+             self._threads = None\r
+@@ -126,11 +126,11 @@ class Threads(object):\r
+                  #THIS FAILS\r
+                  threads = Database().create_query('').search_threads()\r
+                  if len(threads) > 0:              #this 'exhausts' threads\r
+-                     # next line raises NotmuchError(STATUS.NOT_INITIALIZED)!!!\r
++                     # next line raises NotmuchError(status=STATUS.NOT_INITIALIZED)!!!\r
+                      for thread in threads: print thread\r
+         """\r
+         if self._threads is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         i = 0\r
+         # returns 'bool'. On out-of-memory it returns None\r
+@@ -206,7 +206,7 @@ class Thread(object):\r
+               objects are dead.\r
+         """\r
+         if thread_p is None:\r
+-            raise NotmuchError(STATUS.NULL_POINTER)\r
++            raise NotmuchError(status=STATUS.NULL_POINTER)\r
+         self._thread = thread_p\r
+         #keep reference to parent, so we keep it alive\r
+         self._parent = parent\r
+@@ -222,7 +222,7 @@ class Thread(object):\r
+                     is not initialized.\r
+         """\r
+         if self._thread is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         return Thread._get_thread_id(self._thread)\r
\r
+     def get_total_messages(self):\r
+@@ -235,7 +235,7 @@ class Thread(object):\r
+                     is not initialized.\r
+         """\r
+         if self._thread is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         return nmlib.notmuch_thread_get_total_messages(self._thread)\r
\r
+     def get_toplevel_messages(self):\r
+@@ -258,12 +258,12 @@ class Thread(object):\r
+                       * STATUS.NULL_POINTER if search_messages failed\r
+         """\r
+         if self._thread is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         msgs_p = Thread._get_toplevel_messages(self._thread)\r
\r
+         if msgs_p is None:\r
+-            raise NotmuchError(STATUS.NULL_POINTER)\r
++            raise NotmuchError(status=STATUS.NULL_POINTER)\r
\r
+         return Messages(msgs_p, self)\r
\r
+@@ -277,7 +277,7 @@ class Thread(object):\r
+                     is not initialized.\r
+         """\r
+         if self._thread is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         return nmlib.notmuch_thread_get_matched_messages(self._thread)\r
\r
+     def get_authors(self):\r
+@@ -291,7 +291,7 @@ class Thread(object):\r
+         as long as this Thread() is not deleted.\r
+         """\r
+         if self._thread is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         authors = Thread._get_authors(self._thread)\r
+         if authors is None:\r
+             return None\r
+@@ -304,7 +304,7 @@ class Thread(object):\r
+         as long as this Thread() is not deleted.\r
+         """\r
+         if self._thread is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         subject = Thread._get_subject(self._thread)\r
+         if subject is None:\r
+             return None\r
+@@ -319,7 +319,7 @@ class Thread(object):\r
+                     is not initialized.\r
+         """\r
+         if self._thread is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         return Thread._get_newest_date(self._thread)\r
\r
+     def get_oldest_date(self):\r
+@@ -331,7 +331,7 @@ class Thread(object):\r
+                     is not initialized.\r
+         """\r
+         if self._thread is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
+         return Thread._get_oldest_date(self._thread)\r
\r
+     def get_tags(self):\r
+@@ -354,11 +354,11 @@ class Thread(object):\r
+                       * STATUS.NULL_POINTER, on error\r
+         """\r
+         if self._thread is None:\r
+-            raise NotmuchError(STATUS.NOT_INITIALIZED)\r
++            raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
\r
+         tags_p = Thread._get_tags(self._thread)\r
+         if tags_p == None:\r
+-            raise NotmuchError(STATUS.NULL_POINTER)\r
++            raise NotmuchError(status=STATUS.NULL_POINTER)\r
+         return Tags(tags_p, self)\r
\r
+     def __str__(self):\r
+-- \r
+1.7.6.3\r
+\r