def test_export(): import sys def _get_scene(**cfg_overrides): cfg = { "scene": ("misc", "triangle"), "duration": 5, } cfg.update(cfg_overrides) ret = query_scene("pynodegl_utils.examples", **cfg) if "error" in ret: print(ret["error"]) return None return ret def print_progress(progress): sys.stdout.write("\r%d%%" % progress) sys.stdout.flush() if progress == 100: sys.stdout.write("\n") if len(sys.argv) != 2: print("Usage: %s <outfile>" % sys.argv[0]) sys.exit(0) filename = sys.argv[1] app = QtGui.QGuiApplication(sys.argv) exporter = Exporter(_get_scene, filename, 320, 240) exporter.progressed.connect(print_progress) exporter.start() exporter.wait() app.exit()
import credentials import settings import alive workerThread = None def handle_exit(): if workerThread.isRunning(): workerThread.quit() while workerThread.isRunning(): workerThread.wait(QtCore.QDeadlineTimer(500)) if __name__ == "__main__": app = QtGui.QGuiApplication(sys.argv) app.setWindowIcon( QtGui.QIcon( os.path.dirname(os.path.realpath(__file__)) + '/../alivelogo.png')) engine = QtQml.QQmlApplicationEngine() # Worker thread workerThread = QtCore.QThread() workerThread.start() # Signal slots # User settings should come first userSettings = settings.UserSettingsInstance() engine.rootContext().setContextProperty("userSettingsInstance", userSettings)