summaryrefslogtreecommitdiff
path: root/bindings/python
AgeCommit message (Collapse)Author
2012-02-21python: remove :returns: keywords from functions returning nothingJustus Winter
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-21python: rework Directory.set_mtimeJustus Winter
Fix the indentation within the docstring, remove useless remarks, do some trivial refactoring. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-21python: harmonize the sphinx keyword for exceptionsJustus Winter
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-20python: refactor the error handling machineryJustus Winter
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>
2012-02-20python: fix the projects name and update years of the copyright notice in the sphinx docsJustus Winter
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-19python: more error handling fixesJustus Winter
This is a follow up commit to 221c7e0b38177f5f1dbf0561580c15e8aaa49004 fixing more NULL pointer checks. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-18python: remove trailing whitespace within the documentation source filesJustus Winter
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-18python: improve Query.count_messages docstringJustus Winter
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-18python: wrap notmuch_query_count_threads as Query.count_threadsJustus Winter
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-18python: refactor Query classJustus Winter
Put each libnotmuch function reference right in front of the corresponding python wrapper. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-18python: move Query class to its own fileJustus Winter
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-18python: remove unused but imported symbolJustus Winter
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-18python: remove unused but imported symbolJustus Winter
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-15python: implement the context manager protocol for database objectsJustus Winter
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-15python: provide a Database.close functionJustus Winter
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>
2012-02-10py3k: Fix decoding of default database name in Database._get_user_default_dbJustus Winter
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-10python: mock out the ctypes libraryJustus Winter
This allows rtfd.org to build the documentation without libnotmuch. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-10python: Add a Mock class to the sphinx config that can be used to mock modulesJustus Winter
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-02-04Merge commit '0.11.1'David Bremner
Conflicts: NEWS bindings/python/notmuch/database.py bindings/python/notmuch/message.py notmuch.1 NEWS merged by hand, others taken from master.
2012-02-03version: bump to 0.11.1David Bremner
also semi-automatically update man page and python bindings versions.
2012-01-23python: fix error handlingJustus Winter
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. Backported from master to 0.11.
2012-01-22python: fix error handlingJustus Winter
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.
2012-01-16py3k: add a specialized version of _str for python3Justus Winter
All strings are unicode strings in python 3 and the basestring and unicode types are removed hence the need for a specialized version. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-01-13Merge branch 'release'David Bremner
Conflicts: notmuch-reply.c notmuch.1
2012-01-13Update version to 0.11David Bremner
2012-01-09version: update to 0.11~rc3debian/0.11_rc3-10.11_rc3David Bremner
We found another serious-ish bug during freeze.
2012-01-02python: str.decode() doesn't like kwargs in python 2.5Sebastian Spaeth
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>
2012-01-02python: make the result of Message.get_replies() more pythonicJustus Winter
Formerly Message.get_replies() returned an iterator or None forcing users to check the result before iterating over it leading to strange looking code at the call site. Fix this flaw by adding an EmptyMessagesResult class that behaves like the Messages class but immediatly raises StopIteration if used as an iterator and returning objects of this type from Message.get_replies() to indicate that there are no replies.
2012-01-02python: refactor print_messages into format_messages and print_messagesJustus Winter
2012-01-02python: add missing conversions from and to utf-8Justus Winter
2012-01-02py3k: Add and use a mixin class that implements __str__Justus Winter
Amended by Sebastian Spaeth <Sebastian@SSpaeth.de> to include the required sys import in globals.py.
2012-01-02py3k: Rename .next() to __next__(), add python2.x compatibility aliasJustus Winter
2012-01-02py3k: All strings are unicode strings in py3kJustus Winter
2012-01-02py3k: The ConfigParser module has been renamed to configparserJustus Winter
2012-01-02py3k: The execfile built-in has been removed in python 3Justus Winter
2012-01-02version: bump to 0.11~rc2David Bremner
This to "celebrate" pushing a bugfix in at the last minute.
2011-12-25version: update version to 0.11~rc1debian/0.11_rc1-10.11_rc1David Bremner
and keep python, man page, and debian package in sync.
2011-12-06Merge branch 'release'David Bremner
Conflicts: NEWS Conflicts resolved by inserting the 0.10.2 stanza before 0.11
2011-12-06fix format string in Message.__unicode__Patrick Totzke
Since 2b0116119160f2dc83, Message.__str__ doesn't construct a hash containing the thread data before constructing the formatstring. This changes the formatstring to accept positional parameters instead of a hash.
2011-12-06python: Remove stray debug commentSebastian Spaeth
This slipped in wrongly in commit 71e0082eff (due to my fault). Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-12-06python: use wrapped notmuch_*_t types instead of raw pointersThomas Jost
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
2011-12-06errors='ignore' when decode to unicodePatrick Totzke
2011-12-06use __unicode__ for string representationPatrick Totzke
2011-12-06clean up Thread.__str__Patrick Totzke
2011-12-06python: Return a STATUS value in tags_to_flags and flags_to_tagsSebastian Spaeth
We were not returning anything at all, which does not match the API documentation. Fixed. Thanks to Patrick Totzke for the heads up. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-12-06remove unused importsPatrick Totzke
2011-12-06fix sphinx compile-time warningsPatrick Totzke
no changes to the code, only makes compiling the docs smoother as some rsT syntax errors were fixed
2011-12-06pep8 fixesPatrick Totzke
no changes to the code, only fixed stuff denounced by `pep8 *py`
2011-12-05version: bump for bugfix release 0.10.2David Bremner
2011-12-01python: annotate all calls into libnotmuch with typesJustus Winter
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>