def showContextMenu(self, clickPosition):

        globalPos = self.button.mapToGlobal(clickPosition)

        menu = QtGui.QMenu()

        action = menu.addAction('Stop logger')
        action.enabled = (self.numProcesses > 0)

        action = menu.addAction('Stop and delete log file')
        action.enabled = (0 > self.numProcesses and self.lastActiveLogFile)

        action = menu.addAction('Set logger tag')
        action.enabled = (self.numProcesses == 0)

        action = menu.addAction('Copy log filename')
        action.enabled = (self.lastActiveLogFile is not None)

        action = menu.addAction('Review log')
        action.enabled = (self.lastActiveLogFile is not None)


        selectedAction = menu.exec_(globalPos)
        if selectedAction is None:
            return

        if selectedAction.text == 'Copy log filename':
            clipboard = QtGui.QApplication.instance().clipboard()
            clipboard.setText(self.lastActiveLogFile)
            self.showStatusMessage('copy to clipboard: ' + self.lastActiveLogFile)

        elif selectedAction.text == 'Stop logger':
            self.manager.killAllLoggingProcesses()
            self.showStatusMessage('stopped logger')
            self.updateState()

        elif selectedAction.text == 'Stop and delete log file':
            logFileToRemove = self.lastActiveLogFile
            self.manager.killAllLoggingProcesses()
            self.updateState()
            os.remove(logFileToRemove)
            self.showStatusMessage('deleted: ' + logFileToRemove)

        elif selectedAction.text == 'Set logger tag':
            inputDialog = QtGui.QInputDialog()
            inputDialog.setInputMode(inputDialog.TextInput)
            inputDialog.setLabelText('Log file tag:')
            inputDialog.setWindowTitle('Enter tag')
            inputDialog.setTextValue(self.userTag)
            result = inputDialog.exec_()

            if result:
                tag = inputDialog.textValue()
                self.userTag = tag
                self.showStatusMessage('Set lcm logger tag: ' + self.userTag)

        elif selectedAction.text == 'Review log':
            newEnv = dict(os.environ)
            newEnv['LCM_DEFAULT_URL'] = newEnv['LCM_REVIEW_DEFAULT_URL']
            devnull = open(os.devnull, 'w')
            # Pass entire command line invocation of director to subprocess including cfg and json paths
            subprocess.Popen(sys.argv, stdout=devnull, stderr=devnull, env=newEnv)
            subprocess.Popen(['lcm-logplayer-gui', self.lastActiveLogFile], stdout=devnull, stderr=devnull, env=newEnv)
            subprocess.Popen(['bot-procman-sheriff', '-o'], stdout=devnull, stderr=devnull, env=newEnv)
dataset/ETHPy150Open RobotLocomotion/director/src/python/director/lcmloggerwidget.py/LCMLoggerWidget.showContextMenu/swapped operands of `>`