Fix db_path and test

Earlier commit broke the db_path and tests.....
This commit is contained in:
Brian Martin 2019-05-12 15:49:08 -04:00
parent 652a0b0e9b
commit c4900be511

View file

@ -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: