mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-08 00:03:07 +00:00
rework default python script
This commit is contained in:
@@ -478,10 +478,7 @@ async fn push_next_flow_job(
|
||||
serde_json::Value::Number(serde_json::Number::from(0)),
|
||||
);
|
||||
iteration_map.insert("value".to_string(), itered[0].clone());
|
||||
args.insert(
|
||||
"iteration".to_string(),
|
||||
serde_json::Value::Object(iteration_map),
|
||||
);
|
||||
args.insert("iter".to_string(), serde_json::Value::Object(iteration_map));
|
||||
match itered {
|
||||
serde_json::Value::Array(arr) => (Some(args), Some((0 as u8, arr, vec![]))),
|
||||
a @ _ => Err(Error::BadRequest(format!(
|
||||
@@ -506,10 +503,7 @@ async fn push_next_flow_job(
|
||||
"value".to_string(),
|
||||
itered[nindex.to_owned() as usize].clone(),
|
||||
);
|
||||
args.insert(
|
||||
"iteration".to_string(),
|
||||
serde_json::Value::Object(iteration_map),
|
||||
);
|
||||
args.insert("iter".to_string(), serde_json::Value::Object(iteration_map));
|
||||
(
|
||||
Some(args),
|
||||
Some((nindex, itered.clone(), forloop_jobs.clone())),
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
export const PYTHON_INIT_CODE = `import os
|
||||
import wmill
|
||||
from datetime import datetime
|
||||
# Our webeditor includes a syntax, type checker through a language server running pyright
|
||||
# and the autoformatter Black in our servers. Use Cmd/Ctrl + S to autoformat the code.
|
||||
# Beware that the code is only saved when you click Save and not across reload.
|
||||
# You can however navigate to any steps safely.
|
||||
|
||||
"""
|
||||
Use Cmd/Ctrl + S to autoformat the code.
|
||||
The client is used to interact with windmill itself through its standard API.
|
||||
One can explore the methods available through autocompletion of \`client.XXX\`.
|
||||
Only the most common methods are included for ease of use. Request more as
|
||||
feedback if you feel you are missing important ones.
|
||||
One can explore the methods available through autocompletion of \`wmill.XXX\`.
|
||||
"""
|
||||
|
||||
def main(name: str = "Nicolas Bourbaki",
|
||||
age: int = 42,
|
||||
obj: dict = {"even": "dicts"},
|
||||
|
||||
Reference in New Issue
Block a user