Skip to content

Instantly share code, notes, and snippets.

@otsaloma
Created January 4, 2014 18:06
Show Gist options
  • Save otsaloma/8258322 to your computer and use it in GitHub Desktop.
Save otsaloma/8258322 to your computer and use it in GitHub Desktop.
import pyotherside
import threading
import time
def run():
while True:
pyotherside.send("test-errors")
time.sleep(3)
thread = threading.Thread(target=run)
thread.start()
import QtQuick 2.0
import Sailfish.Silica 1.0
import io.thp.pyotherside 1.0
ApplicationWindow {
initialPage: Page {
id: page
Label {
text: "Testing..."
}
function testErrors() {
console.log("starting");
page.nonexistentMethod();
console.log("finished");
}
}
cover: null
Python {
id: py
Component.onCompleted: {
addImportPath(".");
importModule("test_errors", null);
py.setHandler("test-errors", page.testErrors);
}
onError: console.log("PYTHON ERROR: " + traceback);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment