| 1358 | } |
| 1359 | |
| 1360 | void PythonShell::refreshCurrentHelp() |
| 1361 | { |
| 1362 | PythonContext *context = newImportedDummyContext(); |
| 1363 | |
| 1364 | ui->helpText->clear(); |
| 1365 | |
| 1366 | QObject::connect( |
| 1367 | context, &PythonContext::textOutput, |
| 1368 | [this](bool isStdError, const QString &output) { appendText(ui->helpText, output); }); |
| 1369 | |
| 1370 | context->executeString(lit(R"( |
| 1371 | try: |
| 1372 | import keyword |
| 1373 | if keyword.iskeyword("%1"): |
| 1374 | help("%1") |
| 1375 | else: |
| 1376 | help(%1) |
| 1377 | except ImportError: |
| 1378 | help(%1) |
| 1379 | )") |
| 1380 | .arg(ui->helpSearch->text())); |
| 1381 | |
| 1382 | context->Finish(); |
| 1383 | } |
| 1384 | |
| 1385 | void PythonShell::interactive_keypress(QKeyEvent *event) |
| 1386 | { |