diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2012-02-21 00:13:20 +0100 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2012-02-21 00:13:20 +0100 |
commit | 1737ff5290a8ce1f66b4a7aeb6a16146dbc3517c (patch) | |
tree | f0691c7ee961fb910f261e02dc17665a145b4237 /bindings/python/notmuch/database.py | |
parent | 798b74e859734d12c953390bca0753f8e5e1d67c (diff) |
python: rework Directory.set_mtime
Fix the indentation within the docstring, remove useless remarks, do
some trivial refactoring.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Diffstat (limited to 'bindings/python/notmuch/database.py')
-rw-r--r-- | bindings/python/notmuch/database.py | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py index 42a4442f..9f6b3800 100644 --- a/bindings/python/notmuch/database.py +++ b/bindings/python/notmuch/database.py @@ -679,27 +679,19 @@ class Directory(object): don't store a timestamp of 0 unless you are comfortable with that. - :param mtime: A (time_t) timestamp - :returns: Nothing on success, raising an exception on failure. - :raises: :exc:`NotmuchError`: - - :attr:`STATUS`.XAPIAN_EXCEPTION - A Xapian exception occurred, mtime not stored. - :attr:`STATUS`.READ_ONLY_DATABASE - Database was opened in read-only mode so directory - mtime cannot be modified. - :attr:`STATUS`.NOT_INITIALIZED - The directory has not been initialized + :param mtime: A (time_t) timestamp + :raises: :exc:`XapianError` a Xapian exception occurred, mtime + not stored + :raises: :exc:`ReadOnlyDatabaseError` the database was opened + in read-only mode so directory mtime cannot be modified + :raises: :exc:`NotInitializedError` the directory object has not + been 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) - #return on success - if status == STATUS.SUCCESS: - return - #fail with Exception otherwise - raise NotmuchError(status) + if status != STATUS.SUCCESS: + raise NotmuchError(status) def get_mtime(self): """Gets the mtime value of this directory in the database |