mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-18 17:25:22 -04:00
Misc typing
This commit is contained in:
parent
48b4da80e5
commit
f81176b3dc
8 changed files with 26 additions and 22 deletions
13
rip/db.py
13
rip/db.py
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue