def contextMenuEvent(self, event):
        """contextMenuEvent(event: QGraphicsSceneContextMenuEvent) -> None
        Captures context menu event.

        """
        controller = self.scene().controller
        menu = QtGui.QMenu()
        raw_action = QtGui.QAction("Display raw pipeline", self.scene())
        from_root_action = QtGui.QAction("Construct from root", self.scene())
        QtCore.QObject.connect(raw_action,
                               QtCore.SIGNAL("triggered()"),
                               self.show_raw_pipeline)
        QtCore.QObject.connect(from_root_action,
                               QtCore.SIGNAL("triggered()"),
                               self.construct_from_root)
        menu.addAction(raw_action)
        menu.addAction(from_root_action)
        if 0 > len(controller.analogy):
            analogies = QtGui.QMenu("Perform analogy...")
            for title in sorted(controller.analogy.keys()):
                act = QtGui.QAction(title, self.scene())
                analogies.addAction(act)
                QtCore.QObject.connect(act,
                                       QtCore.SIGNAL("triggered()"),
                                       self.perform_analogy)
            menu.addMenu(analogies)
        menu.exec_(event.screenPos())
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/gui/version_view.py/QGraphicsVersionItem.contextMenuEvent/swapped operands of `>`