| 1090 | } |
| 1091 | |
| 1092 | void PythonShell::on_execute_clicked() |
| 1093 | { |
| 1094 | QString command = ui->lineInput->text(); |
| 1095 | |
| 1096 | ANALYTIC_SET(UIFeatures.PythonInterop, true); |
| 1097 | |
| 1098 | appendText(ui->interactiveOutput, command + lit("\n")); |
| 1099 | |
| 1100 | history.push_front(command); |
| 1101 | historyidx = -1; |
| 1102 | |
| 1103 | ui->lineInput->clear(); |
| 1104 | |
| 1105 | // assume a trailing colon means there will be continuation. Store the command and add a continue |
| 1106 | // prompt. If we're already continuing, then wait until we get a blank line before executing. |
| 1107 | if(command.trimmed().right(1) == lit(":") || (!m_storedLines.isEmpty() && !command.isEmpty())) |
| 1108 | { |
| 1109 | appendText(ui->interactiveOutput, lit(".. ")); |
| 1110 | m_storedLines += command + lit("\n"); |
| 1111 | return; |
| 1112 | } |
| 1113 | |
| 1114 | // concatenate any previous lines if we are doing a multi-line command. |
| 1115 | command = m_storedLines + command; |
| 1116 | m_storedLines = QString(); |
| 1117 | |
| 1118 | if(command.trimmed().length() > 0) |
| 1119 | interactiveContext->executeString(command); |
| 1120 | |
| 1121 | appendText(ui->interactiveOutput, lit(">> ")); |
| 1122 | } |
| 1123 | |
| 1124 | void PythonShell::on_clear_clicked() |
| 1125 | { |
nothing calls this directly
no test coverage detected