aboutsummaryrefslogtreecommitdiff
path: root/bindings/python/notmuch/database.py
Commit message (Collapse)AuthorAge
* Merge branch 'release'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 workaroundAustin 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 documentationAustin 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_pJustus Winter2012-05-17
| | | | | | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* | python: add a file abstracting away differences between python 2 and 3Justus Winter2012-05-17
| | | | | | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* | python: Fix the remaining broken NULL pointer testsJustus Winter2012-05-17
| | | | | | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* | python: use relative importsJustus Winter2012-05-17
|/ | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: Update for changes to notmuch_database_get_directoryAustin 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} ↵Austin Clements2012-05-05
| | | | signatures
* python: remove a note stating wrong things about the memory managementJustus Winter2012-04-30
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: document the Database.close functionJustus 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 testsJustus 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 noticesJustus Winter2012-04-29
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: wrap and use notmuch_database_destroy as destructorJustus 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.pyJustus Winter2012-02-23
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: refactor the python bindingsJustus 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 ↵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_filenameJustus Winter2012-02-22
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: work around libnotmuch calling exit(3) in Database.get_directoryJustus Winter2012-02-22
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: Improve the docstring of Database.get_directoryJustus 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__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 DirectoryJustus Winter2012-02-21
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: allow an empty path as parameter to Database.get_directoryJustus Winter2012-02-21
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: remove :returns: keywords from functions returning nothingJustus Winter2012-02-21
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: rework Directory.set_mtimeJustus 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 exceptionsJustus Winter2012-02-21
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: refactor the error handling machineryJustus 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 fixesJustus 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 fileJustus Winter2012-02-18
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: implement the context manager protocol for database objectsJustus Winter2012-02-15
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: provide a Database.close functionJustus 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_dbJustus Winter2012-02-10
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: fix error handlingJustus 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.5Sebastian 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-8Justus Winter2012-01-02
|
* py3k: Rename .next() to __next__(), add python2.x compatibility aliasJustus Winter2012-01-02
|
* py3k: The ConfigParser module has been renamed to configparserJustus Winter2012-01-02
|
* python: Remove stray debug commentSebastian 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 pointersThomas 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 importsPatrick Totzke2011-12-06
|
* fix sphinx compile-time warningsPatrick Totzke2011-12-06
| | | | | no changes to the code, only makes compiling the docs smoother as some rsT syntax errors were fixed
* pep8 fixesPatrick Totzke2011-12-06
| | | | no changes to the code, only fixed stuff denounced by `pep8 *py`
* python: annotate all calls into libnotmuch with typesJustus 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_initializedSebastian 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 documentationSebastian Spaeth2011-10-05
| | | | Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: whitespace fixed in docstringsSebastian Spaeth2011-10-05
| | | | Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Catch up with find_message(by_filename) API changesSebastian 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>
* python: rework creating of SubclassesSebastian Spaeth2011-09-30
| | | | | | | | | | | Add some smart magic, so that when we invoke a NotmuchError(STATUSVALUE), a nicely derived subclass is created, e.g. a OutOfMemoryError. This way users can easily distinguish between error types, while still catching NotmuchError. I have tested this, and hope it works for others too. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: provide more exception classesJustus Winter2011-09-30
| | | | | | | | | | | | | | | | | To make the exception handling more effective in code using the python bindings it is necessary to differentiate between the different kind of failures. Add an exception class for each status code and add a decode classmethod to the NotmuchError class that acts as a factory. Import the new classes in __init__.py so they can be easily imported by anyone. Patch modifed by Sebastian Spaeth. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de> Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: Add new functions in API documentationSebastian Spaeth2011-09-29
| | | | | | | Add documentation for the three new functions and add in which version they have been added. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>