44 json[QStringLiteral(
"language")] =
language;
55 json[QStringLiteral(
"interpreter_args")] = arr;
58 json[QStringLiteral(
"code")] =
code;
61 json[QStringLiteral(
"source_uri")] =
sourceUri;
65 json[QStringLiteral(
"code_sha256")] =
codeSha256;
69 json[QStringLiteral(
"keep_temp_file")] =
true;
80 s.
language = json.value(QStringLiteral(
"language")).toString();
81 s.
interpreter = json.value(QStringLiteral(
"interpreter")).toString();
82 s.
code = json.value(QStringLiteral(
"code")).toString();
83 s.
sourceUri = json.value(QStringLiteral(
"source_uri")).toString();
84 s.
codeSha256 = json.value(QStringLiteral(
"code_sha256")).toString();
85 s.
keepTempFile = json.value(QStringLiteral(
"keep_temp_file")).toBool(
false);
87 const QJsonArray arr = json.value(QStringLiteral(
"interpreter_args")).toArray();
88 for (
const QJsonValue& v : arr) {
100 cbor.insert(QStringLiteral(
"language"),
language);
103 cbor.insert(QStringLiteral(
"interpreter"),
interpreter);
111 cbor.insert(QStringLiteral(
"interpreter_args"), arr);
114 cbor.insert(QStringLiteral(
"code"),
code);
117 cbor.insert(QStringLiteral(
"source_uri"),
sourceUri);
121 cbor.insert(QStringLiteral(
"code_sha256"),
codeSha256);
125 cbor.insert(QStringLiteral(
"keep_temp_file"),
true);
136 s.
language = cbor.value(QStringLiteral(
"language")).toString();
137 s.
interpreter = cbor.value(QStringLiteral(
"interpreter")).toString();
138 s.
code = cbor.value(QStringLiteral(
"code")).toString();
139 s.
sourceUri = cbor.value(QStringLiteral(
"source_uri")).toString();
140 s.
codeSha256 = cbor.value(QStringLiteral(
"code_sha256")).toString();
141 s.
keepTempFile = cbor.value(QStringLiteral(
"keep_temp_file")).toBool();
143 const QCborArray arr = cbor.value(QStringLiteral(
"interpreter_args")).toArray();
144 for (
const QCborValue& v : arr) {
Inline source code carried by a Script-mode graph node — language, interpreter command,...
MNE Analysis Container Format (mna/mnx).
Inline interpreter-launched source code carried by a Script-mode MnaNode.
bool keepTempFile
true → preserve temp script file after execution (debug aid)
QString code
The inline source code (resolved at save-time if sourceUri is set).
static MnaScript fromJson(const QJsonObject &json)
static MnaScript fromCbor(const QCborMap &cbor)
QString codeSha256
SHA-256 of code for integrity verification.
QString language
"python", "shell", "r", "matlab", "octave", "julia"
QJsonObject toJson() const
QStringList interpreterArgs
Extra args before the script file (e.g. ["-u"] for unbuffered Python).