aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Spaeth <sebastian@sspaeth.de>2010-03-16 11:52:56 +0100
committerSebastian Spaeth <sebastian@sspaeth.de>2010-03-16 11:52:56 +0100
commit338e68e545bd101c140bfad81f136cc8b74566b3 (patch)
tree88d2fc53e3187b331ad03fe37d660c70a31c6e63
parent55f1971437550aa382d0c2347a7be62dddcaa761 (diff)
Find the notmuch shared lib rather than hardode a location
--HG-- extra : transplant_source : %DEOdF%80%83%3A%3D%98%5C%AE%81%FE%BA%EF%1A%16%82u%E8
-rw-r--r--cnotmuch/globals.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/cnotmuch/globals.py b/cnotmuch/globals.py
index 553670a4..611c29ed 100644
--- a/cnotmuch/globals.py
+++ b/cnotmuch/globals.py
@@ -1,7 +1,14 @@
from ctypes import CDLL, c_char_p, c_int
+from ctypes.util import find_library
+
+#-----------------------------------------------------------------------------
#package-global instance of the notmuch library
#TODO: lazy load this on first access?
-nmlib = CDLL('/usr/local/lib/libnotmuch.so')
+so = find_library('notmuch')
+if so is None:
+ raise ImportError("Could not find shared 'notmuch' library.")
+nmlib = CDLL(so)
+#-----------------------------------------------------------------------------
class STATUS(object):
SUCCESS = 0