MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / prepareDebug

Method prepareDebug

src/plugins/python/python/pythondebug.cpp:41–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41bool 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
69bool PythonDebug::requestDAPPort(const QString &ppid, const QString &kit,
70 const QString &projectPath,

Callers

nothing calls this directly

Calls 4

getPythonToolPathMethod · 0.80
isEmptyMethod · 0.45
checkInstalledMethod · 0.45

Tested by

no test coverage detected