def writeTo(self, uri, begin, end): if self.isActive(): raise RuntimeError("The recorder is already active.") elif self._player.isRunning(): raise RuntimeError("The recorder's player is already running.") else: if uri not in self._targets: from boing import create self._targets[uri] = create(uri) self._player.addObserver(self._targets[uri]) self._player.setSpeed(float("inf")) self._player.setSender(Player.PostSender()) self._toggledBusy.emit(True) self._player.play(self.buffer().slice(begin, end))
# Init application if not args.nogui: from PyQt4 import QtGui QtGui.QApplication.setStyle(QtGui.QStyleFactory.create("plastique")) app = QtGui.QApplication(sys.argv) else: boing.config["--no-gui"] = True app = QtCore.QCoreApplication(sys.argv) # (Reenable Ctrl-C to quit the application) timer = QtCore.QTimer(timeout=lambda: None) timer.start(150) signal.signal(signal.SIGINT, lambda *args: app.quit()) # Init the pipeline try: pipeline = boing.create(args.config) except Exception as exc: import traceback logging.error(exc) if args.traceback: traceback.print_exc(args.traceback) if not args.force: sys.exit(1) # Handle common options if args.graph: # Setup graph view node = boing.create(args.graph) node.grapher.setStarters((pipeline, )) if args.console is not None: # Setup console local = {"__name__": "__console__",
def test_not_None(self): for uri in uris[self.scheme]["valid"]: self.assertIsNotNone(boing.create(uri)) for uri, exc in uris[self.scheme]["invalid"]: self.assertRaises(exc, boing.create, uri)