X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=cnotmuch%2Fglobals.py;h=611c29ed8fcee4f93cc27503d81536801c935c37;hb=bb5870b9af7d023d7d61233dc19d73772d84fdc5;hp=553670a49c5c1460a1c77c24ff3b144e5cf2a05a;hpb=55f1971437550aa382d0c2347a7be62dddcaa761;p=notmuch 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