| 39 | } |
| 40 | |
| 41 | bool PythonDebug::prepareDebug(const QString &fileName, QString &retMsg) |
| 42 | { |
| 43 | if (fileName.isEmpty()) { |
| 44 | metaObject()->invokeMethod(this, "notifyMessage", |
| 45 | Qt::QueuedConnection, |
| 46 | Q_ARG(QString, tr("There is no opened python file, please open."))); |
| 47 | return false; |
| 48 | } |
| 49 | |
| 50 | d->interpreterPath = config::ConfigUtil::instance()->getConfigureParamPointer()->pythonVersion.path; |
| 51 | if (d->interpreterPath.isEmpty()) //project has not set interpreter to config. use default interpreter |
| 52 | d->interpreterPath = OptionManager::getInstance()->getPythonToolPath(); |
| 53 | if (d->interpreterPath.isEmpty()) { |
| 54 | metaObject()->invokeMethod(this, "notifyMessage", |
| 55 | Qt::QueuedConnection, |
| 56 | Q_ARG(QString, tr("An interpreter is necessary. Please select it in options dialog or install it."))); |
| 57 | return false; |
| 58 | } |
| 59 | |
| 60 | PIPInstaller installer; |
| 61 | if (!installer.checkInstalled(d->interpreterPath, "debugpy")) { |
| 62 | metaObject()->invokeMethod(this, &PythonDebug::notifyToInstall); |
| 63 | return false; |
| 64 | } |
| 65 | |
| 66 | return true; |
| 67 | } |
| 68 | |
| 69 | bool PythonDebug::requestDAPPort(const QString &ppid, const QString &kit, |
| 70 | const QString &projectPath, |
nothing calls this directly
no test coverage detected