Python backend "App" becomes QmlBridge

Is now strictly about setting up asyncio/uvloop and providing the
functions for QML to interact with it and call backend coroutines.

The appdirs attribute is moved to Backend.
This commit is contained in:
miruka
2019-12-18 06:44:18 -04:00
parent 5d7d66f99b
commit 9e372d01d5
7 changed files with 46 additions and 56 deletions

View File

@@ -12,7 +12,7 @@ Python {
addImportPath("src")
addImportPath("qrc:/src")
importNames("backend", ["APP"], () => {
importNames("backend", ["BRIDGE"], () => {
loadSettings(() => {
callCoro("saved_accounts.any_saved", [], any => {
if (any) { py.callCoro("load_saved_accounts", []) }
@@ -45,7 +45,7 @@ Python {
function callSync(name, args=[]) {
return call_sync("APP.backend." + name, args)
return call_sync("BRIDGE.backend." + name, args)
}
@@ -56,7 +56,7 @@ Python {
let future = privates.makeFuture()
call("APP.call_backend_coro", [name, uuid, args], pyFuture => {
call("BRIDGE.call_backend_coro", [name, uuid, args], pyFuture => {
future.privates.pythonFuture = pyFuture
})
@@ -76,7 +76,7 @@ Python {
let call_args = [accountId, name, uuid, args]
call("APP.call_client_coro", call_args, pyFuture => {
call("BRIDGE.call_client_coro", call_args, pyFuture => {
future.privates.pythonFuture = pyFuture
})
})