aboutsummaryrefslogtreecommitdiffhomepage
path: root/bindings/python/notmuch/database.py
Commit message (Collapse)AuthorAge
* python: handle return status of database close and destroyGravatar Peter Wang2014-09-16
| | | | | Throw an exception if notmuch_database_close or notmuch_database_destroy fail.
* python: fix the creation of notmuch databasesGravatar Justus Winter2013-01-23
| | | | | | | Remove the superfluous mode argument given to notmuch_database_create fixing the creation of notmuch databases using python code. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: remove Database.db_pGravatar Justus Winter2012-12-21
| | | | | | The function has been marked as deprecated in 0.14 and is now removed. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* Merge branch 'release'Gravatar David Bremner2012-05-23
|\ | | | | | | | | merge 0.13.1 bugfix patches back to master, fixes for emacs reply and spurious directory document creation.
| * python: Remove find_message_by_filename workaroundGravatar Austin Clements2012-05-23
| | | | | | | | | | | | | | | | Now that notmuch_database_find_message_by_filename works on read-only databases, remove the workaround that disabled it on read-write databases. This also adds a regression test for find_message_by_filename.
| * python: Update Database.get_directory documentationGravatar Austin Clements2012-05-23
| | | | | | | | | | | | notmuch_database_get_directory no longer returns an error for read-only databases, so remove ReadOnlyDatabaseError from the list of get_directory exceptions.
* | python: deprecate Database.db_pGravatar Justus Winter2012-05-17
| | | | | | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* | python: add a file abstracting away differences between python 2 and 3Gravatar Justus Winter2012-05-17
| | | | | | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* | python: Fix the remaining broken NULL pointer testsGravatar Justus Winter2012-05-17
| | | | | | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* | python: use relative importsGravatar Justus Winter2012-05-17
|/ | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: Update for changes to notmuch_database_get_directoryGravatar Austin Clements2012-05-15
| | | | | | notmuch_database_get_directory now returns NOTMUCH_STATUS_READ_ONLY_DATABASE on its own (rather than crashing) so the workaround in Database.get_directory is no longer necessary.
* python: Update Python bindings for new notmuch_database_{open, create} ↵Gravatar Austin Clements2012-05-05
| | | | signatures
* python: remove a note stating wrong things about the memory managementGravatar Justus Winter2012-04-30
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: document the Database.close functionGravatar Justus Winter2012-04-30
| | | | | | | | Put a prominent warning into the docstring of Database.close, make the function show up in the sphinx doc and refer to the warning in the paragraph mentioning the context manager protocol. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: fix NULL pointer testsGravatar Justus Winter2012-04-30
| | | | | | | Fix the NULL pointer tests in the destructors of all classes and Database.create. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: strip superfluous single quote from copyright noticesGravatar Justus Winter2012-04-29
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: wrap and use notmuch_database_destroy as destructorGravatar Justus Winter2012-04-28
| | | | | | Adapt the python bindings to the notmuch_database_close split. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: move the exception classes into error.pyGravatar Justus Winter2012-02-23
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: refactor the python bindingsGravatar Justus Winter2012-02-22
| | | | | | | | Move the Directory class into its own file, merge the two Filenames classes into one, deprecate Filenames.as_iterator, update the documentation accordingly. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: work around libnotmuch calling exit(3) in ↵Gravatar Justus Winter2012-02-22
| | | | | | Database.find_message_by_filename Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: improve the docstring of Database.find_message_by_filenameGravatar Justus Winter2012-02-22
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: work around libnotmuch calling exit(3) in Database.get_directoryGravatar Justus Winter2012-02-22
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: Improve the docstring of Database.get_directoryGravatar Justus Winter2012-02-22
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: avoid using a magic value for database mode in Database.__init__Gravatar Justus Winter2012-02-22
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: fix the type nonsense of the first parameter of class DirectoryGravatar Justus Winter2012-02-21
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: allow an empty path as parameter to Database.get_directoryGravatar Justus Winter2012-02-21
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: remove :returns: keywords from functions returning nothingGravatar Justus Winter2012-02-21
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: rework Directory.set_mtimeGravatar Justus Winter2012-02-21
| | | | | | | Fix the indentation within the docstring, remove useless remarks, do some trivial refactoring. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: harmonize the sphinx keyword for exceptionsGravatar Justus Winter2012-02-21
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: refactor the error handling machineryGravatar Justus Winter2012-02-20
| | | | | | | | Raise specific error classes instead of a generic NotmuchError with an magic status value (e.g. NotmuchError(STATUS.NULL_POINTER) -> NullPointerError()), update the documentation accordingly. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: more error handling fixesGravatar Justus Winter2012-02-19
| | | | | | | This is a follow up commit to 221c7e0b38177f5f1dbf0561580c15e8aaa49004 fixing more NULL pointer checks. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: move Query class to its own fileGravatar Justus Winter2012-02-18
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: implement the context manager protocol for database objectsGravatar Justus Winter2012-02-15
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: provide a Database.close functionGravatar Justus Winter2012-02-15
| | | | | | | | Rename Database.__del__ to Database.close, move it just below the open function and call close() in a newly created destructor just below the constructor. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* py3k: Fix decoding of default database name in Database._get_user_default_dbGravatar Justus Winter2012-02-10
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: fix error handlingGravatar Justus Winter2012-01-22
| | | | | | | | | | | Before 3434d1940 the return values of libnotmuch functions were declared as c_void_p and the code checking for errors compared the returned value to None, which is the ctypes equivalent of a NULL pointer. But said commit wrapped all the data types in python classes and the semantic changed in a subtle way. If a function returns NULL, the wrapped python value is falsish, but no longer equal to None.
* python: str.decode() doesn't like kwargs in python 2.5Gravatar Sebastian Spaeth2012-01-02
| | | | | | | | | Recent changes introduced lots of unicodification of strings, mostly in the form of .decode('utf-8', errors='ignore'). However, python 2.5 does not like the errors keyword argument and complains. It does work when used as a simple arg though, so that's what this patch does. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: add missing conversions from and to utf-8Gravatar Justus Winter2012-01-02
|
* py3k: Rename .next() to __next__(), add python2.x compatibility aliasGravatar Justus Winter2012-01-02
|
* py3k: The ConfigParser module has been renamed to configparserGravatar Justus Winter2012-01-02
|
* python: Remove stray debug commentGravatar Sebastian Spaeth2011-12-06
| | | | | | This slipped in wrongly in commit 71e0082eff (due to my fault). Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: use wrapped notmuch_*_t types instead of raw pointersGravatar Thomas Jost2011-12-06
| | | | | | | | Now that types are checked correctly, we also need to make sure that all the arguments actually are instances of these types. Otherwise the function calls will fail and raise an exception similar to this one: ctypes.ArgumentError: argument 3: <type 'exceptions.TypeError'>: expected LP_LP_NotmuchMessageS instance instead of pointer to c_void_p
* remove unused importsGravatar Patrick Totzke2011-12-06
|
* fix sphinx compile-time warningsGravatar Patrick Totzke2011-12-06
| | | | | no changes to the code, only makes compiling the docs smoother as some rsT syntax errors were fixed
* pep8 fixesGravatar Patrick Totzke2011-12-06
| | | | no changes to the code, only fixed stuff denounced by `pep8 *py`
* python: annotate all calls into libnotmuch with typesGravatar Justus Winter2011-12-01
| | | | | | | | | | | Add type information to the ctypes._FuncPtr wrappers and use the wrapper classes instead of c_void_p for pointers to notmuch_*_t. This enables the ctypes library to type check parameters being handed to functions from the notmuch library. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: help function Query._assert_query_is_initializedGravatar Sebastian Spaeth2011-10-05
| | | | | | | | Remove code duplication by using the new helper function. Also raise the new fine grained exceptions in many cases, rather than the more generic NotmuchErrors. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: clean up docstrings and API documentationGravatar Sebastian Spaeth2011-10-05
| | | | Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: whitespace fixed in docstringsGravatar Sebastian Spaeth2011-10-05
| | | | Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Catch up with find_message(by_filename) API changesGravatar Sebastian Spaeth2011-10-05
| | | | | | | message is now an out parameter, and we get an additional status code as a result. Hurray \o/. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>