create db without prompt

This commit is contained in:
alicezou 2022-03-27 09:56:47 -04:00
parent 1167453ed8
commit 9917f2ac3a

View file

@ -900,9 +900,15 @@ class Database:
"""The current revision of the database. To be increased whenever
data is written in a transaction.
"""
def _path_checker(self, path):
newpath = os.path.dirname(path)
if not os.path.isdir(newpath):
os.makedirs(newpath)
def __init__(self, path, timeout=5.0):
self.path = path
self._path_checker(path)
self.timeout = timeout
self._connections = {}