[PATCH 6/9] python: rename _verify_dir_initialized to _assert_dir_is_initialized
Justus Winter
4winter at informatik.uni-hamburg.de
Sun Sep 25 18:05:34 PDT 2011
Rename the function to clarify its effect and remove all the comments
accompanying each call to the function.
Signed-off-by: Justus Winter <4winter at 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
More information about the notmuch
mailing list