Commit 87a4c7e3 authored by Tijmen de Mes's avatar Tijmen de Mes

Prevent traceback on fresh start

parent cd25488a
...@@ -8,6 +8,7 @@ from PyQt5.QtGui import QIcon ...@@ -8,6 +8,7 @@ from PyQt5.QtGui import QIcon
from application.notification import IObserver, NotificationCenter, NotificationData from application.notification import IObserver, NotificationCenter, NotificationData
from application.python import Null from application.python import Null
from application.python.types import Singleton from application.python.types import Singleton
from application.system import makedirs
from datetime import date, timezone from datetime import date, timezone
from dateutil.parser import parse from dateutil.parser import parse
...@@ -220,7 +221,7 @@ class TableVersions(object, metaclass=Singleton): ...@@ -220,7 +221,7 @@ class TableVersions(object, metaclass=Singleton):
__versions__ = {} __versions__ = {}
def __init__(self): def __init__(self):
db_file = ApplicationData.get('message_history.db') db_file = ApplicationData.get('message_history.db')
db_uri = f'sqlite://{db_file}' db_uri = f'sqlite://{db_file}'
self._initialize(db_uri) self._initialize(db_uri)
...@@ -273,6 +274,7 @@ class MessageHistory(object, metaclass=Singleton): ...@@ -273,6 +274,7 @@ class MessageHistory(object, metaclass=Singleton):
def __init__(self): def __init__(self):
db_file = ApplicationData.get('message_history.db') db_file = ApplicationData.get('message_history.db')
db_uri = f'sqlite://{db_file}' db_uri = f'sqlite://{db_file}'
makedirs(ApplicationData.directory)
self._initialize(db_uri) self._initialize(db_uri)
@run_in_thread('db') @run_in_thread('db')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment