]> git.notmuchmail.org Git - notmuch/commit
python: rework creating of Subclasses
authorSebastian Spaeth <Sebastian@SSpaeth.de>
Fri, 30 Sep 2011 14:04:42 +0000 (16:04 +0200)
committerSebastian Spaeth <Sebastian@SSpaeth.de>
Fri, 30 Sep 2011 14:04:42 +0000 (16:04 +0200)
commit8c51525e8213e074a845ad53d7196453952623dd
tree41a5ff444b2c532aec8c5a64b03be9a3ca496600
parentb6a01735d238733ef78f941a8b7c4bad59db2734
python: rework creating of Subclasses

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>
bindings/python/notmuch/database.py
bindings/python/notmuch/globals.py