Fix db_path and test
Earlier commit broke the db_path and tests.....
This commit is contained in:
parent
652a0b0e9b
commit
c4900be511
1 changed files with 5 additions and 8 deletions
|
|
@ -77,15 +77,12 @@ def db_file():
|
||||||
|
|
||||||
|
|
||||||
def os_db_path():
|
def os_db_path():
|
||||||
db_path = ""
|
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
|
os.makedirs(os.getenv("APPDATA"), exist_ok=True) #Ensure db_path directory exists or create
|
||||||
db_path = os.path.join(os.getenv("APPDATA"))
|
return os.path.join(os.getenv("APPDATA"), "bumper.db")
|
||||||
else:
|
else:
|
||||||
db_path = os.path.expanduser("~/.config")
|
os.makedirs(os.path.expanduser("~/.config"), exist_ok=True) #Ensure db_path directory exists or create
|
||||||
|
return os.path.expanduser("~/.config/bumper.db")
|
||||||
os.makedirs(db_path, exist_ok=True) #Ensure db_path directory exists or create
|
|
||||||
return os.path.join(db_path, "bumper.db")
|
|
||||||
|
|
||||||
def db_get():
|
def db_get():
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue