Re: [PATCH 1/7] Split notmuch_database_close into two functions
[notmuch-archives.git] / e0 / 53b30f3343362616171b804e7ba230d3dde895
1 Return-Path: <teythoon@jade-hamburg.de>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id D477A431FD0\r
6         for <notmuch@notmuchmail.org>; Sun, 25 Sep 2011 18:06:42 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id d+UngnCTmFOm for <notmuch@notmuchmail.org>;\r
16         Sun, 25 Sep 2011 18:06:41 -0700 (PDT)\r
17 Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68])\r
18         (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id C358A431FB6\r
21         for <notmuch@notmuchmail.org>; Sun, 25 Sep 2011 18:06:40 -0700 (PDT)\r
22 Received: from mail.jade-hamburg.de (unknown [85.183.11.228])\r
23         (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
24         (No client certificate requested)\r
25         by mail.cryptobitch.de (Postfix) with ESMTPSA id 80024505B23\r
26         for <notmuch@notmuchmail.org>; Mon, 26 Sep 2011 03:06:39 +0200 (CEST)\r
27 Received: by mail.jade-hamburg.de (Postfix, from userid 401)\r
28         id 01E35DF2A0; Mon, 26 Sep 2011 03:06:38 +0200 (CEST)\r
29 Received: from thinkbox.jade-hamburg.de (unknown [10.1.1.109])\r
30         (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
31         (No client certificate requested) (Authenticated sender: teythoon)\r
32         by mail.jade-hamburg.de (Postfix) with ESMTPSA id 49E25DF2A2;\r
33         Mon, 26 Sep 2011 03:06:14 +0200 (CEST)\r
34 Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.76)\r
35         (envelope-from <teythoon@thinkbox.jade-hamburg.de>)\r
36         id 1R7ze5-0007OS-Gm; Mon, 26 Sep 2011 03:06:09 +0200\r
37 From: Justus Winter <4winter@informatik.uni-hamburg.de>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH 6/9] python: rename _verify_dir_initialized to\r
40         _assert_dir_is_initialized\r
41 Date: Mon, 26 Sep 2011 03:05:34 +0200\r
42 Message-Id:\r
43  <1316999137-28257-6-git-send-email-4winter@informatik.uni-hamburg.de>\r
44 X-Mailer: git-send-email 1.7.6.3\r
45 In-Reply-To:\r
46  <1316999137-28257-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
47 References:\r
48  <1316999137-28257-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
49 X-Mailman-Approved-At: Mon, 26 Sep 2011 09:17:56 -0700\r
50 Cc: Justus Winter <4winter@informatik.uni-hamburg.de>\r
51 X-BeenThere: notmuch@notmuchmail.org\r
52 X-Mailman-Version: 2.1.13\r
53 Precedence: list\r
54 List-Id: "Use and development of the notmuch mail system."\r
55         <notmuch.notmuchmail.org>\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
59 List-Post: <mailto:notmuch@notmuchmail.org>\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
63 X-List-Received-Date: Mon, 26 Sep 2011 01:06:43 -0000\r
64 \r
65 Rename the function to clarify its effect and remove all the comments\r
66 accompanying each call to the function.\r
67 \r
68 Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>\r
69 ---\r
70  bindings/python/notmuch/database.py |   14 +++++---------\r
71  1 files changed, 5 insertions(+), 9 deletions(-)\r
72 \r
73 diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py\r
74 index ecc5c17..edde70e 100644\r
75 --- a/bindings/python/notmuch/database.py\r
76 +++ b/bindings/python/notmuch/database.py\r
77 @@ -648,7 +648,7 @@ class Directory(object):\r
78      _get_child_directories = nmlib.notmuch_directory_get_child_directories\r
79      _get_child_directories.restype = c_void_p\r
80  \r
81 -    def _verify_dir_initialized(self):\r
82 +    def _assert_dir_is_initialized(self):\r
83          """Raises a NotmuchError(status=STATUS.NOT_INITIALIZED) if dir_p is None"""\r
84          if self._dir_p is None:\r
85              raise NotmuchError(status=STATUS.NOT_INITIALIZED)\r
86 @@ -703,8 +703,7 @@ class Directory(object):\r
87                          STATUS.NOT_INITIALIZED\r
88                            The directory has not been initialized\r
89          """\r
90 -        #Raise a NotmuchError(status=STATUS.NOT_INITIALIZED) if the dir_p is None\r
91 -        self._verify_dir_initialized()\r
92 +        self._assert_dir_is_initialized()\r
93  \r
94          #TODO: make sure, we convert the mtime parameter to a 'c_long'\r
95          status = Directory._set_mtime(self._dir_p, mtime)\r
96 @@ -727,8 +726,7 @@ class Directory(object):\r
97                          STATUS.NOT_INITIALIZED\r
98                            The directory has not been initialized\r
99          """\r
100 -        #Raise a NotmuchError(status=STATUS.NOT_INITIALIZED) if self.dir_p is None\r
101 -        self._verify_dir_initialized()\r
102 +        self._assert_dir_is_initialized()\r
103  \r
104          return Directory._get_mtime(self._dir_p)\r
105  \r
106 @@ -746,8 +744,7 @@ class Directory(object):\r
107          The returned filenames will be the basename-entries only (not\r
108          complete paths.\r
109          """\r
110 -        #Raise a NotmuchError(status=STATUS.NOT_INITIALIZED) if self._dir_p is None\r
111 -        self._verify_dir_initialized()\r
112 +        self._assert_dir_is_initialized()\r
113  \r
114          files_p = Directory._get_child_files(self._dir_p)\r
115          return Filenames(files_p, self)\r
116 @@ -759,8 +756,7 @@ class Directory(object):\r
117          The returned filenames will be the basename-entries only (not\r
118          complete paths.\r
119          """\r
120 -        #Raise a NotmuchError(status=STATUS.NOT_INITIALIZED) if self._dir_p is None\r
121 -        self._verify_dir_initialized()\r
122 +        self._assert_dir_is_initialized()\r
123  \r
124          files_p = Directory._get_child_directories(self._dir_p)\r
125          return Filenames(files_p, self)\r
126 -- \r
127 1.7.6.3\r
128 \r