Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PythonXX.zip problem in QtIFW #1497

Merged
merged 1 commit into from
Dec 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ rm -f python.zip
# end of download python
fi

cd "$(dirname "$0")"/../data
cp -r "$cache_dir"/"PYTHON_$python_ver"/{python*.zip,unicodedata.pyd} .
mkdir -p "$(dirname "$0")/../data/python-runtime/"
rsync -avR "$cache_dir"/"PYTHON_$python_ver"/./{python*.zip,unicodedata.pyd} "$(dirname "$0")/../data/python-runtime/"
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class TwoDExecutionControl : public trikScriptRunner::TrikScriptControlInterface
TwoDExecutionControl(trik::TrikBrick &brick,
const QSharedPointer<trik::robotModel::twoD::TrikTwoDRobotModel> &model);

~TwoDExecutionControl() override;
~TwoDExecutionControl() override = default;

int random(int from, int to) const override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,17 @@ void TrikKitInterpreterPluginBase::initKitInterpreterPluginBase
if (!qEnvironmentVariableIsEmpty("TRIK_PYTHONPATH")) {
enablePython = true;
} else if (PlatformInfo::osType().startsWith("windows")) {
auto dir = QDir(QCoreApplication::applicationDirPath());
dir.makeAbsolute();
const auto &zips = dir.entryInfoList({"python*.zip"}, QDir::Files | QDir::Readable);
if (zips.size() == 1) {
const auto &zip = zips.first();
const auto &path = zip.absoluteFilePath() + ';' + zip.absolutePath();
qputenv("TRIK_PYTHONPATH", path.toLocal8Bit());
auto dir = QDir(QCoreApplication::applicationDirPath()+"/python-runtime/");
dir.makeAbsolute();
if (dir.exists()) {
enablePython = true;
auto path = dir.path();
const auto &zips = dir.entryInfoList({"python*.zip"}, QDir::Files | QDir::Readable);
if (zips.size() == 1) {
const auto &zip = zips.first();
path += ';' + zip.absoluteFilePath();
}
qputenv("TRIK_PYTHONPATH", path.toLocal8Bit());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ TwoDExecutionControl::TwoDExecutionControl(
qRegisterMetaType<QVector<int32_t>>("QVector<int32_t>");
}

TwoDExecutionControl::~TwoDExecutionControl()
{
}

int TwoDExecutionControl::random(int from, int to) const
{
using namespace kitBase::robotModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<context>
<name>TwoDExecutionControl</name>
<message>
<location filename="../../../../plugins/robots/interpreters/trikKitInterpreterCommon/src/twoDExecutionControl.cpp" line="+44"/>
<location filename="../../../../plugins/robots/interpreters/trikKitInterpreterCommon/src/twoDExecutionControl.cpp" line="+40"/>
<source>No cofigured random device</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -242,7 +242,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+52"/>
<location line="+55"/>
<source>TRIK_PYTHONPATH must be set correctly to run Python script.</source>
<translation type="unfinished"></translation>
</message>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
<context>
<name>TwoDExecutionControl</name>
<message>
<location filename="../../../../plugins/robots/interpreters/trikKitInterpreterCommon/src/twoDExecutionControl.cpp" line="+44"/>
<location filename="../../../../plugins/robots/interpreters/trikKitInterpreterCommon/src/twoDExecutionControl.cpp" line="+40"/>
<source>No cofigured random device</source>
<translation>Генератор случайных чисел не сконфигурирован</translation>
</message>
Expand Down Expand Up @@ -307,7 +307,7 @@
<translation>Оставновить</translation>
</message>
<message>
<location line="+52"/>
<location line="+55"/>
<source>TRIK_PYTHONPATH must be set correctly to run Python script.</source>
<translation>Для запуска программы на Python доложна быть корректно выставлена переменная окружения TRIK_PYTHONPATH</translation>
</message>
Expand Down