Fix Engine.app_dir and leftover Backend.pdb()

Use __file__ instead of sys.argv[0] to determine the current script's
path, which works correctly when importing the package from another dir
This commit is contained in:
miruka 2019-05-01 01:32:06 -04:00
parent 12ce4cdb30
commit 3299aefaf1
2 changed files with 1 additions and 2 deletions

View File

@ -4,7 +4,6 @@ import "Banners"
import "RoomEventList"
HColumnLayout {
Component.onCompleted: Backend.pdb()
property string userId: ""
property string roomId: ""

View File

@ -26,7 +26,7 @@ class Engine(QQmlApplicationEngine):
self._sigint_timer.start(100)
super().__init__()
self.app_dir = Path(sys.argv[0]).resolve().parent
self.app_dir = Path(__file__).resolve().parent
from .backend.backend import Backend
self.backend = Backend(self)