예제 #1
0
	def jump_to(self, node):
		ancestors, current, descendants = stream_index.common_paths(node, self._node)
		if current is None:
			raise RuntimeError("Cannot jump to node %s" % node)
		if not descendants:
			_moduleLogger.info("Current node is the target")
			return
		child = descendants[0]
		window = self._window_from_node(child)
		window.jump_to(node)
예제 #2
0
	def _get_current_row(self):
		if self._player.node is None:
			return -1
		ancestors, current, descendants = stream_index.common_paths(self._player.node, self._node)
		if not descendants:
			return -1
		activeChild = descendants[0]
		for i, row in enumerate(self._model):
			if activeChild is row[0]:
				return i
		else:
			return -1
예제 #3
0
	def _on_jump(self, source, node):
		ancestors, current, descendants = stream_index.common_paths(node, self._node)
		if current is None:
			_moduleLogger.info("%s is not the target, moving up" % self._node)
			self.emit("jump-to", node)
			self._window.destroy()
			return
		if not descendants:
			_moduleLogger.info("Current node is the target")
			return
		child = descendants[0]
		window = self._window_from_node(child)
		window.jump_to(node)