Raise an exception in Sleepycat store when database dir is missing

diff -r c4e233ef4c39 rdflib/store/Sleepycat.py
--- a/rdflib/store/Sleepycat.py	Wed Jul 04 10:01:09 2007 +0200
+++ b/rdflib/store/Sleepycat.py	Wed Jul 04 10:02:14 2007 +0200
@@ -10,6 +10,12 @@ from threading import Thread
 
 import logging
 _logger = logging.getLogger(__name__)
+
+class MissingDbDir(Exception):
+    def __init__(self, dir_):
+        self.dir = dir_
+        Exception.__init__(self, "The database directory at %s is missing" %
+                           (dir_,))
 
 class Sleepycat(Store):
     context_aware = True
@@ -33,11 +39,11 @@ class Sleepycat(Store):
         envsetflags  = db.DB_CDB_ALLDB
         envflags = db.DB_INIT_MPOOL | db.DB_INIT_CDB | db.DB_THREAD
         if not exists(homeDir):
-            if create==True:
-                mkdir(homeDir) # TODO: implement create method and refactor this to it
-                self.create(homeDir)
-            else:
-                return -1
+            if not create:
+                raise MissingDbDir(homeDir)
+            mkdir(homeDir) # TODO: implement create method and refactor this to it
+            self.create(homeDir)
+            
         db_env = db.DBEnv()
         db_env.set_cachesize(0, 1024*1024*50) # TODO
         #db_env.set_lg_max(1024*1024)
@@ -49,12 +55,18 @@ class Sleepycat(Store):
         return self.__open
     
     def open(self, path, create=True):
+        """ Open database.
+        @param path: Path to database directory.
+        @param create: Create directory if missing?
+        @raise MissingDbDir: Database directory doesn't exist and C{create}
+        was not specified.
+        """
         homeDir = path
 
         if self.__identifier is None:
             self.__identifier = URIRef(pathname2url(abspath(homeDir)))
 
-        self.db_env = db_env = self._init_db_environment(homeDir, create)        
+        self.db_env = db_env = self._init_db_environment(homeDir, create)
         self.__open = True
 
         dbname = None
