diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2011-09-26 03:05:34 +0200 |
---|---|---|
committer | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2011-09-29 09:29:17 +0200 |
commit | f88d985e507a96b5179c2de793b9b75da55457a3 (patch) | |
tree | 7775c4dc7c44bc4a8183af58579c505a59afaeb4 /bindings | |
parent | 94a1bb88aadd2d591815b47df9e886dc594df21f (diff) |
python: rename _verify_dir_initialized to _assert_dir_is_initialized
Rename the function to clarify its effect and remove all the comments
accompanying each call to the function.
Modified by Sebastian Spaeth to apply cleanly again and remove some
blank lines.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/python/notmuch/database.py | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py index a19dd59..9fb30e6 100644 --- a/bindings/python/notmuch/database.py +++ b/bindings/python/notmuch/database.py @@ -697,7 +697,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.NOT_INITIALIZED) if dir_p is None""" if self._dir_p is None: raise NotmuchError(STATUS.NOT_INITIALIZED) @@ -752,9 +752,7 @@ class Directory(object): STATUS.NOT_INITIALIZED The directory has not been initialized """ - #Raise a NotmuchError(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) @@ -776,9 +774,7 @@ class Directory(object): STATUS.NOT_INITIALIZED The directory has not been initialized """ - #Raise a NotmuchError(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) # Make mtime attribute a property of Directory() @@ -795,9 +791,7 @@ class Directory(object): The returned filenames will be the basename-entries only (not complete paths. """ - #Raise a NotmuchError(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) @@ -808,9 +802,7 @@ class Directory(object): The returned filenames will be the basename-entries only (not complete paths. """ - #Raise a NotmuchError(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) |