Beispiel #1
0
 def create_store(path):
     if os.path.exists(path):
         if not os.path.isdir(path) or os.listdir(path):
             raise CreationError("Path is not a directory or is not empty")
         exists = True
     else:
         exists = False
     try:
         if not exists:
             os.mkdir(path)
         os.mkdir(os.path.join(path, 'objects'))
     except OSError as e:  # pragma: no cover
         raise CreationError("Could not create directories: %s: %s" % (
             e.__class__.__name__, e.message))
     MetadataStore.create_db(os.path.join(path, 'database'))
Beispiel #2
0
 def create_store(path):
     if os.path.exists(path):
         if not os.path.isdir(path) or os.listdir(path):
             raise CreationError("Path is not a directory or is not empty")
         exists = True
     else:
         exists = False
     try:
         if not exists:
             os.mkdir(path)
         os.mkdir(os.path.join(path, 'objects'))
     except OSError as e:  # pragma: no cover
         raise CreationError("Could not create directories: %s: %s" %
                             (e.__class__.__name__, e.message))
     MetadataStore.create_db(os.path.join(path, 'database'))