Pass ride context to Python DPs when available (#4214)

Partial fix for #4095 - Python DPs now work in automatic mode using the run on save option.
This commit is contained in:
Paul Johnson
2022-04-28 16:55:39 +01:00
committed by GitHub
parent be1af0f6d6
commit 3a9620a3d9

View File

@@ -23,7 +23,8 @@ bool FixPyDataProcessor::postProcess(RideFile *rideFile, DataProcessorConfig *se
QString errText;
bool useNewThread = op != "PYTHON";
FixPyRunner pyRunner(nullptr, rideFile, useNewThread);
Context* context = (rideFile) ? rideFile->context : nullptr;
FixPyRunner pyRunner(context, rideFile, useNewThread);
return pyRunner.run(pyScript->source, pyScript->iniKey, errText) == 0;
}