summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Cabessa <ced@ryick.net>2010-04-05 03:03:51 +0200
committerCedric Cabessa <ced@ryick.net>2010-04-05 03:03:51 +0200
commitf378f45893bb4263402008b2abd8aab522901fb6 (patch)
tree82e66430560626e516c329daaf2d1bce0b846ba0
parentdfa9eb8afa66b79800addc2102b4bd153f4495ab (diff)
find_library does not read LD_LIBRARY_PATH, but CDLL does.
-rw-r--r--cnotmuch/globals.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/cnotmuch/globals.py b/cnotmuch/globals.py
index ef2686f..fa20ae8 100644
--- a/cnotmuch/globals.py
+++ b/cnotmuch/globals.py
@@ -3,17 +3,17 @@ from ctypes.util import find_library
#-----------------------------------------------------------------------------
#package-global instance of the notmuch library
-#TODO: lazy load this on first access?
-so = find_library('notmuch')
-if so is None:
- raise ImportError("Could not find shared 'notmuch' library.")
-nmlib = CDLL(so)
+try:
+ nmlib = CDLL("libnotmuch.so.1")
+except:
+ raise ImportError("Could not find shared 'notmuch' library.")
+
#-----------------------------------------------------------------------------
class Enum(object):
- """Provides ENUMS as "code=Enum(['a','b','c'])" where code.a=0 etc..."""
- def __init__(self, names):
- for number, name in enumerate(names):
- setattr(self, name, number)
+ """Provides ENUMS as "code=Enum(['a','b','c'])" where code.a=0 etc..."""
+ def __init__(self, names):
+ for number, name in enumerate(names):
+ setattr(self, name, number)
#-----------------------------------------------------------------------------
class Status(Enum):