Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id D477A431FD0 for ; Sun, 25 Sep 2011 18:06:42 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d+UngnCTmFOm for ; Sun, 25 Sep 2011 18:06:41 -0700 (PDT) Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id C358A431FB6 for ; Sun, 25 Sep 2011 18:06:40 -0700 (PDT) Received: from mail.jade-hamburg.de (unknown [85.183.11.228]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cryptobitch.de (Postfix) with ESMTPSA id 80024505B23 for ; Mon, 26 Sep 2011 03:06:39 +0200 (CEST) Received: by mail.jade-hamburg.de (Postfix, from userid 401) id 01E35DF2A0; Mon, 26 Sep 2011 03:06:38 +0200 (CEST) Received: from thinkbox.jade-hamburg.de (unknown [10.1.1.109]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: teythoon) by mail.jade-hamburg.de (Postfix) with ESMTPSA id 49E25DF2A2; Mon, 26 Sep 2011 03:06:14 +0200 (CEST) Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.76) (envelope-from ) id 1R7ze5-0007OS-Gm; Mon, 26 Sep 2011 03:06:09 +0200 From: Justus Winter <4winter@informatik.uni-hamburg.de> To: notmuch@notmuchmail.org Subject: [PATCH 6/9] python: rename _verify_dir_initialized to _assert_dir_is_initialized Date: Mon, 26 Sep 2011 03:05:34 +0200 Message-Id: <1316999137-28257-6-git-send-email-4winter@informatik.uni-hamburg.de> X-Mailer: git-send-email 1.7.6.3 In-Reply-To: <1316999137-28257-1-git-send-email-4winter@informatik.uni-hamburg.de> References: <1316999137-28257-1-git-send-email-4winter@informatik.uni-hamburg.de> X-Mailman-Approved-At: Mon, 26 Sep 2011 09:17:56 -0700 Cc: Justus Winter <4winter@informatik.uni-hamburg.de> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2011 01:06:43 -0000 Rename the function to clarify its effect and remove all the comments accompanying each call to the function. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de> --- bindings/python/notmuch/database.py | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-) diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py index ecc5c17..edde70e 100644 --- a/bindings/python/notmuch/database.py +++ b/bindings/python/notmuch/database.py @@ -648,7 +648,7 @@ class Directory(object): _get_child_directories = nmlib.notmuch_directory_get_child_directories _get_child_directories.restype = c_void_p - def _verify_dir_initialized(self): + def _assert_dir_is_initialized(self): """Raises a NotmuchError(status=STATUS.NOT_INITIALIZED) if dir_p is None""" if self._dir_p is None: raise NotmuchError(status=STATUS.NOT_INITIALIZED) @@ -703,8 +703,7 @@ class Directory(object): STATUS.NOT_INITIALIZED The directory has not been initialized """ - #Raise a NotmuchError(status=STATUS.NOT_INITIALIZED) if the dir_p is None - self._verify_dir_initialized() + self._assert_dir_is_initialized() #TODO: make sure, we convert the mtime parameter to a 'c_long' status = Directory._set_mtime(self._dir_p, mtime) @@ -727,8 +726,7 @@ class Directory(object): STATUS.NOT_INITIALIZED The directory has not been initialized """ - #Raise a NotmuchError(status=STATUS.NOT_INITIALIZED) if self.dir_p is None - self._verify_dir_initialized() + self._assert_dir_is_initialized() return Directory._get_mtime(self._dir_p) @@ -746,8 +744,7 @@ class Directory(object): The returned filenames will be the basename-entries only (not complete paths. """ - #Raise a NotmuchError(status=STATUS.NOT_INITIALIZED) if self._dir_p is None - self._verify_dir_initialized() + self._assert_dir_is_initialized() files_p = Directory._get_child_files(self._dir_p) return Filenames(files_p, self) @@ -759,8 +756,7 @@ class Directory(object): The returned filenames will be the basename-entries only (not complete paths. """ - #Raise a NotmuchError(status=STATUS.NOT_INITIALIZED) if self._dir_p is None - self._verify_dir_initialized() + self._assert_dir_is_initialized() files_p = Directory._get_child_directories(self._dir_p) return Filenames(files_p, self) -- 1.7.6.3