Misc typing

This commit is contained in:
Nathan Thomas 2023-03-16 19:55:12 -07:00
parent 48b4da80e5
commit f81176b3dc
8 changed files with 26 additions and 22 deletions

View file

@ -14,7 +14,7 @@ class Database:
structure: dict
name: str
def __init__(self, path, dummy=False):
def __init__(self, path: str, dummy: bool = False):
"""Create a Database instance.
:param path: Path to the database file.
@ -23,13 +23,12 @@ class Database:
assert self.structure != []
assert self.name
if dummy or path is None:
self.path = None
self.is_dummy = True
return
self.is_dummy = False
self.path = path
self.is_dummy = dummy
if self.is_dummy:
return
if not os.path.exists(self.path):
self.create()