setta 0.0.14.dev0__py3-none-any.whl → 0.0.14.dev2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- setta/__init__.py +1 -1
- setta/routers/interactive.py +24 -6
- setta/static/constants/Settings.json +1 -0
- setta/static/constants/constants.json +1 -0
- setta/static/frontend/assets/{index-eTf7hTS7.js → index-B_D80dlv.js} +172 -172
- setta/static/frontend/assets/index-DQjclEVk.css +32 -0
- setta/static/frontend/index.html +2 -2
- setta/tasks/tasks.py +61 -4
- setta/tasks/utils.py +28 -8
- {setta-0.0.14.dev0.dist-info → setta-0.0.14.dev2.dist-info}/METADATA +1 -1
- {setta-0.0.14.dev0.dist-info → setta-0.0.14.dev2.dist-info}/RECORD +15 -15
- setta/static/frontend/assets/index-xJaZMJy2.css +0 -32
- {setta-0.0.14.dev0.dist-info → setta-0.0.14.dev2.dist-info}/LICENSE +0 -0
- {setta-0.0.14.dev0.dist-info → setta-0.0.14.dev2.dist-info}/WHEEL +0 -0
- {setta-0.0.14.dev0.dist-info → setta-0.0.14.dev2.dist-info}/entry_points.txt +0 -0
- {setta-0.0.14.dev0.dist-info → setta-0.0.14.dev2.dist-info}/top_level.txt +0 -0
setta/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.0.14.
|
1
|
+
__version__ = "0.0.14.dev2"
|
setta/routers/interactive.py
CHANGED
@@ -18,6 +18,7 @@ from setta.code_gen.export_selected import (
|
|
18
18
|
)
|
19
19
|
from setta.code_gen.find_placeholders import parse_template_var
|
20
20
|
from setta.tasks.fns.utils import replace_template_vars_with_random_names
|
21
|
+
from setta.tasks.tasks import construct_subprocess_key
|
21
22
|
from setta.utils.constants import C
|
22
23
|
from setta.utils.utils import multireplace
|
23
24
|
|
@@ -35,6 +36,22 @@ class FormatCodeRequest(BaseModel):
|
|
35
36
|
candidateTemplateVars: dict
|
36
37
|
|
37
38
|
|
39
|
+
@router.post(C.ROUTE_SEND_PROJECT_TO_INTERACTIVE_CODE)
|
40
|
+
async def route_send_project_to_interactive_code(
|
41
|
+
x: UpdateInteractiveCodeRequest,
|
42
|
+
tasks=Depends(get_tasks),
|
43
|
+
):
|
44
|
+
to_run = []
|
45
|
+
for idx, p in enumerate(x.projects):
|
46
|
+
exporter_obj_in_memory = export_for_in_memory_fn(p)
|
47
|
+
to_run.append(
|
48
|
+
tasks.call_in_memory_subprocess_fn_with_new_exporter_obj(
|
49
|
+
p["projectConfig"]["id"], idx, exporter_obj_in_memory
|
50
|
+
)
|
51
|
+
)
|
52
|
+
return await process_returned_content_from_multiple_tasks(tasks, to_run)
|
53
|
+
|
54
|
+
|
38
55
|
@router.post(C.ROUTE_UPDATE_INTERACTIVE_CODE)
|
39
56
|
async def route_update_interactive_code(
|
40
57
|
x: UpdateInteractiveCodeRequest,
|
@@ -46,13 +63,12 @@ async def route_update_interactive_code(
|
|
46
63
|
update_interactive_code(p, tasks, lsp_writers, idx)
|
47
64
|
for idx, p in enumerate(x.projects)
|
48
65
|
]
|
66
|
+
return await process_returned_content_from_multiple_tasks(tasks, update_tasks)
|
49
67
|
|
50
|
-
# Run all updates in parallel and gather results
|
51
|
-
all_content = await asyncio.gather(*update_tasks)
|
52
68
|
|
53
|
-
|
69
|
+
async def process_returned_content_from_multiple_tasks(tasks, to_run):
|
70
|
+
all_content = await asyncio.gather(*to_run)
|
54
71
|
content = [item for sublist in all_content for item in sublist]
|
55
|
-
|
56
72
|
inMemorySubprocessInfo = tasks.getInMemorySubprocessInfo()
|
57
73
|
return {"inMemorySubprocessInfo": inMemorySubprocessInfo, "content": content}
|
58
74
|
|
@@ -106,7 +122,9 @@ async def update_interactive_code(p, tasks, lsp_writers, idx):
|
|
106
122
|
code_graph.append(
|
107
123
|
{
|
108
124
|
"imports": imports,
|
109
|
-
"subprocess_key":
|
125
|
+
"subprocess_key": construct_subprocess_key(
|
126
|
+
project_config_id, section_id, idx
|
127
|
+
),
|
110
128
|
"subprocessStartMethod": p["sections"][section_id][
|
111
129
|
"subprocessStartMethod"
|
112
130
|
],
|
@@ -115,7 +133,7 @@ async def update_interactive_code(p, tasks, lsp_writers, idx):
|
|
115
133
|
|
116
134
|
initialContent = await tasks.add_custom_fns(
|
117
135
|
code_graph,
|
118
|
-
|
136
|
+
exporter_obj=exporter_obj_in_memory,
|
119
137
|
)
|
120
138
|
|
121
139
|
return initialContent
|
@@ -42,6 +42,7 @@
|
|
42
42
|
"showProjectOverviewTabShortcut": "O",
|
43
43
|
"runCodeShortcut": "Mod + Enter",
|
44
44
|
"runAllCodeShortcut": "Mod + Shift + Enter",
|
45
|
+
"sendProjectToAllInteractiveCode": "Alt + I",
|
45
46
|
"paramSelect": "Mod + Shift",
|
46
47
|
"formatCode": "Shift + Alt + F",
|
47
48
|
"selectionKeyCode": "Shift",
|
@@ -70,6 +70,7 @@
|
|
70
70
|
"ROUTE_SAVE_CODE_INFO": "/codeInfo/save",
|
71
71
|
"ROUTE_COPY_SECTIONS": "/copySections",
|
72
72
|
"ROUTE_UPDATE_INTERACTIVE_CODE": "/updateInteractiveCode",
|
73
|
+
"ROUTE_SEND_PROJECT_TO_INTERACTIVE_CODE": "/sendProjectTointeractiveCode",
|
73
74
|
"ROUTE_FORMAT_CODE": "/formatCode",
|
74
75
|
"ROUTE_SEND_ARTIFACT": "/sendArtfiact",
|
75
76
|
"ROUTE_LOAD_ARTIFACTS": "/loadArtifacts",
|