mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-15 08:59:55 +00:00
Added ScriptContext for Python APIs called from DataFilter scripts
Carry RideItem, Specification and Metrics to consider the cases when the script is part of a UserMetric or an LTMPlot formula Python series, activityWbal and activityXdata honor RideItem and Specification Python activityMetrics honors ScriptContext RideItem and Metrics Python activityMeanMax honors ScriptContext RideItem Force recomputation of metrics just in case Python Scripts were used before
This commit is contained in:
@@ -287,7 +287,7 @@ PythonEmbed::PythonEmbed(const bool verbose, const bool interactive) : verbose(v
|
||||
}
|
||||
|
||||
// run on called thread
|
||||
void PythonEmbed::runline(Context *context, QString line)
|
||||
void PythonEmbed::runline(ScriptContext scriptContext, QString line)
|
||||
{
|
||||
PyGILState_STATE gstate;
|
||||
gstate = PyGILState_Ensure();
|
||||
@@ -301,7 +301,7 @@ void PythonEmbed::runline(Context *context, QString line)
|
||||
Py_DECREF(ident);
|
||||
|
||||
// add to the thread/context map
|
||||
contexts.insert(threadid, context);
|
||||
contexts.insert(threadid, scriptContext);
|
||||
|
||||
// run and generate errors etc
|
||||
messages.clear();
|
||||
|
||||
Reference in New Issue
Block a user